goshodo

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2022 License: MIT Imports: 18 Imported by: 0

README

goshodo

Test Status MIT License PkgGoDev

goshodo is a CLI tool for shodo (https://shodo.ink) in Go

Synopsis

% export SHODO_API_TOKEN=...
% export SHODO_API_ROOT=https://...
% goshodo lint testdata/demo.md
Linting...
3:11 もしかしてAI
    飛行機の欠便があり、運行(→ 運航)状況が変わった。 バ
6:5 もしかしてAI
    ません。  これが私で(→ の)自己紹介です。  こ
...

Installation

# Install the latest version. (Install it into ./bin/ by default).
% curl -sfL https://raw.githubusercontent.com/Songmu/goshodo/main/install.sh | sh -s

# Specify installation directory ($(go env GOPATH)/bin/) and version.
% curl -sfL https://raw.githubusercontent.com/Songmu/goshodo/main/install.sh | sh -s -- -b $(go env GOPATH)/bin [vX.Y.Z]

# In alpine linux (as it does not come with curl by default)
% wget -O - -q https://raw.githubusercontent.com/Songmu/goshodo/main/install.sh | sh -s [vX.Y.Z]

# go install
% go install github.com/Songmu/goshodo/cmd/goshodo@latest

See Also

Author

Songmu

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, argv []string, outStream, errStream io.Writer) error

Run the goshodo

Types

type CheckStyle

type CheckStyle struct {
	XMLName xml.Name         `xml:"checkstyle"`
	Version string           `xml:"version,attr"`
	Files   []CheckStyleFile `xml:"file"`
}

type CheckStyleError

type CheckStyleError struct {
	XMLName  xml.Name `xml:"error"`
	Line     int      `xml:"line,attr"`
	Column   int      `xml:"column,attr,omitempty"`
	Severity string   `xml:"severity,attr,omitempty"`
	Message  string   `xml:"message,attr"`
	Source   string   `xml:"source,attr"`
}

type CheckStyleFile

type CheckStyleFile struct {
	XMLName xml.Name          `xml:"file"`
	Name    string            `xml:"name,attr"`
	Errors  []CheckStyleError `xml:"error"`
}

type Lint

type Lint struct {
	Result        *LintResult
	File, Content string
	// contains filtered or unexported fields
}

func (*Lint) Correspond

func (l *Lint) Correspond(m LintMessage, bound int) (string, string, string)

rune range

func (*Lint) Line added in v0.0.2

func (l *Lint) Line(n int) string

0 origin

type LintMessage

type LintMessage struct {
	After    string       `json:"after"`
	Before   string       `json:"before"`
	From     LintPosition `json:"from"`
	To       LintPosition `json:"to"`
	Index    int          `json:"index"`
	IndexTo  int          `json:"index_to"`
	Message  string       `json:"message"`
	Severity severity     `json:"severity"`
}

type LintPosition

type LintPosition struct {
	Ch   int `json:"ch"`
	Line int `json:"line"`
}

func (LintPosition) String

func (p LintPosition) String() string

type LintResult

type LintResult struct {
	Messages []LintMessage `json:"messages"`
	Status   lintStatus    `json:"status"`
	Updated  int64         `json:"updated"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL