shellcheck

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	File      string `json:"file"`
	Line      uint   `json:"line"`
	EndLine   uint   `json:"endLine"`
	Column    uint   `json:"column"`
	EndColumn uint   `json:"endColumn"`
	Level     string `json:"level"`
	Code      uint   `json:"code"`
	Message   string `json:"message"`
	Fix       *Fix   `json:"fix"`
}

func (*Comment) ToCodeActionFixLint

func (c *Comment) ToCodeActionFixLint(uri string) *lsp.CodeAction

func (*Comment) ToCodeActionIgnore

func (c *Comment) ToCodeActionIgnore(uri, documentText string, diagnosticRange *lsp.Range) *lsp.CodeAction

func (*Comment) ToDiagnostic

func (c *Comment) ToDiagnostic() lsp.Diagnostic

type Fix

type Fix struct {
	Replacements []struct {
		Line           uint   `json:"line"`
		Column         uint   `json:"column"`
		EndColumn      uint   `json:"endColumn"`
		InsertionPoint string `json:"insertionPoint"`
		Replacement    string `json:"replacement"`
		Precedence     uint   `json:"precedence"`
	} `json:"replacements"`
}

type Options

type Options struct {
	Include  []string
	Exclude  []string
	Enable   []string // See `shellcheck --list-optional`
	Dialect  string   // sh, bash, dash, ksh, busybox
	Severity string   // error, warning, info, style
}

type ShellCheckResult

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

https://github.com/koalaman/shellcheck/wiki/Integration

func Run

func Run(filecontent string, options Options) (*ShellCheckResult, error)

func (*ShellCheckResult) ContainsFixable

func (s *ShellCheckResult) ContainsFixable() bool

func (*ShellCheckResult) ToCodeActionFlat

func (s *ShellCheckResult) ToCodeActionFlat(uri string) lsp.CodeAction

func (*ShellCheckResult) ToDiagnostics

func (s *ShellCheckResult) ToDiagnostics() []lsp.Diagnostic

Jump to

Keyboard shortcuts

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