Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: improve documentation for goimport local-prefixes #3349

Merged
merged 15 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ linters-settings:
template-path: /path/to/my/template.tmpl

goimports:
# Put imports beginning with prefix after 3rd-party packages.
# It's a comma-separated list of prefixes.
# A comma-separated list of prefixes, which, if set, checks import paths
# with the given prefixes are grouped after 3rd-party packages.
# Default: ""
local-prefixes: github.com/org/project

Expand Down
3 changes: 2 additions & 1 deletion pkg/golinters/goimports.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ func NewGoimports(settings *config.GoImportsSettings) *goanalysis.Linter {

return goanalysis.NewLinter(
goimportsName,
"In addition to fixing imports, goimports also formats your code in the same style as gofmt.",
"Check import statements are formatted according to the 'goimport' command. "+
"Reformat imports in autofix mode.",
[]*analysis.Analyzer{analyzer},
nil,
).WithContextSetter(func(lintCtx *linter.Context) {
Expand Down