Skip to content

Commit

Permalink
dev: clarifies and homogenizes formatter descriptions (#5265)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Dec 29, 2024
1 parent 30f4265 commit 2a06dcb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/golinters/gci/internal/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewAnalyzer() *analysis.Analyzer {

a := &analysis.Analyzer{
Name: "gci",
Doc: "A tool that control Go package import order and make it always deterministic.",
Doc: "Checks if code and import statements are formatted, it makes import statements always deterministic.",
Run: runAnalysis,
Requires: []*analysis.Analyzer{inspect.Analyzer},
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/golinters/gofmt/gofmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ func New(settings *config.GoFmtSettings) *goanalysis.Linter {

return goanalysis.NewLinter(
linterName,
"Gofmt checks whether code was gofmt-ed. By default "+
"this tool runs with -s option to check for code simplification",
"Checks if the code is formatted according to 'gofmt' command.",
[]*analysis.Analyzer{analyzer},
nil,
).WithContextSetter(func(lintCtx *linter.Context) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/gofumpt/gofumpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func New(settings *config.GofumptSettings) *goanalysis.Linter {

return goanalysis.NewLinter(
linterName,
"Gofumpt checks whether code was gofumpt-ed.",
"Checks if code and import statements are formatted, with additional rules.",
[]*analysis.Analyzer{analyzer},
nil,
).WithContextSetter(func(lintCtx *linter.Context) {
Expand Down
5 changes: 2 additions & 3 deletions pkg/golinters/goimports/goimports.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ func New(settings *config.GoImportsSettings) *goanalysis.Linter {

return goanalysis.NewLinter(
linterName,
"Check import statements are formatted according to the 'goimport' command. "+
"Reformat imports in autofix mode.",
"Checks if the code and import statements are formatted according to the 'goimports' command.",
[]*analysis.Analyzer{analyzer},
nil,
).WithContextSetter(func(lintCtx *linter.Context) {
Expand Down Expand Up @@ -56,7 +55,7 @@ func runGoImports(lintCtx *linter.Context, pass *analysis.Pass) error {

err = internal.ExtractDiagnosticFromPatch(pass, file, string(diff), lintCtx)
if err != nil {
return fmt.Errorf("can't extract issues from gofmt diff output %q: %w", string(diff), err)
return fmt.Errorf("can't extract issues from goimports diff output %q: %w", string(diff), err)
}
}

Expand Down

0 comments on commit 2a06dcb

Please sign in to comment.