Documentation
¶
Overview ¶
Package linters is a namespace for gh-aw's custom Go analysis linters.
The actual analyzers are implemented in subpackages. All 21 active analyzers:
- contextcancelnotdeferred — flags context cancel functions called directly instead of deferred
- ctxbackground — flags context.Background() inside functions that already receive a context
- errormessage — flags non-actionable error message patterns in changed files
- errstringmatch — flags brittle strings.Contains(err.Error(), "...") checks
- excessivefuncparams — flags function declarations with too many positional parameters
- fileclosenotdeferred — flags file Close() calls that are not deferred
- fmterrorfnoverbs — flags fmt.Errorf calls with no format verbs, recommending errors.New
- fprintlnsprintf — flags fmt.Fprintln(..., fmt.Sprintf(...)) patterns
- jsonmarshalignoredeerror — flags json.Marshal/Unmarshal calls where the error is discarded with _
- largefunc — flags function bodies that exceed a configurable line-count threshold
- manualmutexunlock — flags non-deferred mutex Unlock() calls
- osexitinlibrary — flags os.Exit calls in library packages
- ossetenvlibrary — flags os.Setenv calls in library packages
- panic-in-library-code — flags panic() calls in library packages
- rawloginlib — flags direct usage of the standard log package in library packages
- regexpcompileinfunction — flags regexp.MustCompile/Compile calls inside functions
- seenmapbool — flags map[string]bool used as a set that should use map[string]struct{}
- ssljson — validates ssl.json skill artifacts in .github/skills/ against the SSL spec
- strconvparseignorederror — flags strconv parsing calls where the error is discarded with _
- tolowerequalfold — flags case-insensitive comparisons via ToLower/ToUpper that should use EqualFold
- uncheckedtypeassertion — flags unchecked single-value type assertions
The package also exposes a compatibility alias (ErrorMessageAnalyzer) that points to the errormessage subpackage analyzer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorMessageAnalyzer = errormessage.Analyzer
ErrorMessageAnalyzer exposes the actionable error-message analyzer.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package contextcancelnotdeferred implements a Go analysis linter that flags context cancel functions called manually instead of deferred.
|
Package contextcancelnotdeferred implements a Go analysis linter that flags context cancel functions called manually instead of deferred. |
|
Package ctxbackground implements a Go analysis linter that flags calls to context.Background() inside functions that already receive a context.Context parameter.
|
Package ctxbackground implements a Go analysis linter that flags calls to context.Background() inside functions that already receive a context.Context parameter. |
|
Package errormessage implements a Go analysis linter that enforces actionable error-message patterns in changed files.
|
Package errormessage implements a Go analysis linter that enforces actionable error-message patterns in changed files. |
|
Package errstringmatch implements a Go analysis linter that flags calls to strings.Contains(err.Error(), "literal") that perform brittle substring matching on error messages instead of using errors.Is or errors.As.
|
Package errstringmatch implements a Go analysis linter that flags calls to strings.Contains(err.Error(), "literal") that perform brittle substring matching on error messages instead of using errors.Is or errors.As. |
|
Package excessivefuncparams implements a Go analysis linter that flags functions with too many positional parameters.
|
Package excessivefuncparams implements a Go analysis linter that flags functions with too many positional parameters. |
|
Package fileclosenotdeferred implements a Go analysis linter that flags file operations where Close() is not immediately deferred.
|
Package fileclosenotdeferred implements a Go analysis linter that flags file operations where Close() is not immediately deferred. |
|
Package fmterrorfnoverbs implements a Go analysis linter that flags calls to fmt.Errorf where the format string contains no format verbs, in which case errors.New is the idiomatic and cheaper alternative.
|
Package fmterrorfnoverbs implements a Go analysis linter that flags calls to fmt.Errorf where the format string contains no format verbs, in which case errors.New is the idiomatic and cheaper alternative. |
|
Package fprintlnsprintf implements a Go analysis linter that flags fmt.Fprintln(w, fmt.Sprintf(...)) calls that should be rewritten as fmt.Fprintf(w, ...).
|
Package fprintlnsprintf implements a Go analysis linter that flags fmt.Fprintln(w, fmt.Sprintf(...)) calls that should be rewritten as fmt.Fprintf(w, ...). |
|
internal
|
|
|
nolint
Package nolint provides shared helpers for nolint-directive detection used by linters within pkg/linters.
|
Package nolint provides shared helpers for nolint-directive detection used by linters within pkg/linters. |
|
Package jsonmarshalignoredeerror implements a Go analysis linter that flags json.Marshal and json.Unmarshal calls where the error return is discarded with _.
|
Package jsonmarshalignoredeerror implements a Go analysis linter that flags json.Marshal and json.Unmarshal calls where the error return is discarded with _. |
|
Package largefunc implements a Go analysis linter that flags functions whose body exceeds a configurable line threshold.
|
Package largefunc implements a Go analysis linter that flags functions whose body exceeds a configurable line threshold. |
|
Package manualmutexunlock implements a Go analysis linter that flags mutex Unlock() calls that are not deferred, which can lead to deadlocks if a panic or early return occurs between Lock() and Unlock().
|
Package manualmutexunlock implements a Go analysis linter that flags mutex Unlock() calls that are not deferred, which can lead to deadlocks if a panic or early return occurs between Lock() and Unlock(). |
|
Package osexitinlibrary implements a Go analysis linter that flags os.Exit calls in library (pkg/) packages.
|
Package osexitinlibrary implements a Go analysis linter that flags os.Exit calls in library (pkg/) packages. |
|
Package ossetenvlibrary implements a Go analysis linter that flags os.Setenv and os.Unsetenv calls in non-main, non-test packages.
|
Package ossetenvlibrary implements a Go analysis linter that flags os.Setenv and os.Unsetenv calls in non-main, non-test packages. |
|
Package panicinlibrarycode implements a Go analysis linter that flags panic() calls in library (pkg/) packages.
|
Package panicinlibrarycode implements a Go analysis linter that flags panic() calls in library (pkg/) packages. |
|
Package rawloginlib implements a Go analysis linter that flags standard log package calls in library (pkg/) packages.
|
Package rawloginlib implements a Go analysis linter that flags standard log package calls in library (pkg/) packages. |
|
Package regexpcompileinfunction implements a Go analysis linter that flags calls to regexp.MustCompile() and regexp.Compile() inside function bodies.
|
Package regexpcompileinfunction implements a Go analysis linter that flags calls to regexp.MustCompile() and regexp.Compile() inside function bodies. |
|
Package seenmapbool implements a Go analysis linter that flags "seen" maps declared as map[string]bool (using true as sentinel) that should use map[string]struct{} to avoid allocating a bool per entry.
|
Package seenmapbool implements a Go analysis linter that flags "seen" maps declared as map[string]bool (using true as sentinel) that should use map[string]struct{} to avoid allocating a bool per entry. |
|
Package ssljson implements a Go analysis linter that validates .github/skills/*/ssl.json files against the SSL specification rules.
|
Package ssljson implements a Go analysis linter that validates .github/skills/*/ssl.json files against the SSL specification rules. |
|
Package strconvparseignorederror implements a Go analysis linter that flags strconv parsing calls (Atoi, ParseInt, ParseFloat, ParseBool, ParseUint) where the error return is discarded with _.
|
Package strconvparseignorederror implements a Go analysis linter that flags strconv parsing calls (Atoi, ParseInt, ParseFloat, ParseBool, ParseUint) where the error return is discarded with _. |
|
Package tolowerequalfold implements a Go analysis linter that flags case-insensitive string comparisons performed via strings.ToLower (or strings.ToUpper) combined with == that should instead use strings.EqualFold.
|
Package tolowerequalfold implements a Go analysis linter that flags case-insensitive string comparisons performed via strings.ToLower (or strings.ToUpper) combined with == that should instead use strings.EqualFold. |
|
Package uncheckedtypeassertion implements a Go analysis linter that flags single-value type assertions x.(T) that may panic at runtime if the dynamic type does not match, and where the two-value safe form x.(T) is not used.
|
Package uncheckedtypeassertion implements a Go analysis linter that flags single-value type assertions x.(T) that may panic at runtime if the dynamic type does not match, and where the two-value safe form x.(T) is not used. |
Click to show internal directories.
Click to hide internal directories.