runner

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comments

type Comments struct {
	Comments []Warning `json:"comments"`
}

Comments represents a dict containing a list of Warnings emitted by shellcheck.

type Runner

type Runner struct {
	Path    string
	Dir     string
	Exclude string
	Enable  string
	Shell   string

	Logger interface {
		Printf(string, ...interface{})
	}
}

A Runner manages shellcheck execution and output parsing.

func (*Runner) Version

func (r *Runner) Version() (string, error)

Version returns the version of the shellcheck binary. It will return an error if `shellcheck --version` fails or has unexpected output.

func (*Runner) Warnings

func (r *Runner) Warnings(paths ...string) ([]Warning, error)

Warnings executes shellcheck against the given paths and returns Warnings for any issues detected.

type Warning

type Warning struct {
	File      string `json:"file"`
	Line      int32  `json:"line"`
	EndLine   int32  `json:"endLine"`
	Column    int32  `json:"column"`
	EndColumn int32  `json:"endColumn"`
	Level     string `json:"level"`
	Code      int32  `json:"code"`
	Message   string `json:"message"`
}

A Warning represents an issue detected by shellcheck.

func (*Warning) WikiURL

func (w *Warning) WikiURL() string

WikiURL returns a link to more information about this warning type.

Jump to

Keyboard shortcuts

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