6 lines
21 KiB
JSON
6 lines
21 KiB
JSON
{
|
|
"enable": "Enabled by default linters:\nerrcheck: errcheck is a program for checking for unchecked errors in Go code. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false]\ngosimple (megacheck): Linter for Go source code that specializes in simplifying code [fast: false, auto-fix: false]\ngovet (vet, vetshadow): Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: false, auto-fix: false]\nineffassign: Detects when assignments to existing variables are not used [fast: true, auto-fix: false]\nstaticcheck (megacheck): It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint. [fast: false, auto-fix: false]\nunused (megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false]",
|
|
"disable": "Disabled by default linters:\nasasalint: check for pass []any as any in variadic func(...any) [fast: false, auto-fix: false]\nasciicheck: checks that all code identifiers does not have non-ASCII symbols in the name [fast: true, auto-fix: false]\nbidichk: Checks for dangerous unicode character sequences [fast: true, auto-fix: false]\nbodyclose: checks whether HTTP response body is closed successfully [fast: false, auto-fix: false]\ncontainedctx: containedctx is a linter that detects struct contained context.Context field [fast: false, auto-fix: false]\ncontextcheck: check whether the function uses a non-inherited context [fast: false, auto-fix: false]\ncyclop: checks function and package cyclomatic complexity [fast: false, auto-fix: false]\ndeadcode [deprecated]: Finds unused code [fast: false, auto-fix: false]\ndecorder: check declaration order and count of types, constants, variables and functions [fast: true, auto-fix: false]\ndepguard: Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]\ndogsled: Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false]\ndupl: Tool for code clone detection [fast: true, auto-fix: false]\ndupword: checks for duplicate words in the source code [fast: true, auto-fix: true]\ndurationcheck: check for two durations multiplied together [fast: false, auto-fix: false]\nerrchkjson: Checks types passed to the json encoding functions. Reports unsupported types and reports occations, where the check for the returned error can be omitted. [fast: false, auto-fix: false]\nerrname: Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. [fast: false, auto-fix: false]\nerrorlint: errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false]\nexecinquery: execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false]\nexhaustive: check exhaustiveness of enum switch statements [fast: false, auto-fix: false]\nexhaustivestruct [deprecated]: Checks if all struct's fields are initialized [fast: false, auto-fix: false]\nexhaustruct: Checks if all structure fields are initialized [fast: false, auto-fix: false]\nexportloopref: checks for pointers to enclosing loop variables [fast: false, auto-fix: false]\nforbidigo: Forbids identifiers [fast: false, auto-fix: false]\nforcetypeassert: finds forced type assertions [fast: true, auto-fix: false]\nfunlen: Tool for detection of long functions [fast: true, auto-fix: false]\ngci: Gci controls Go package import order and makes it always deterministic. [fast: true, auto-fix: false]\nginkgolinter: enforces standards of using ginkgo and gomega [fast: false, auto-fix: false]\ngocheckcompilerdirectives: Checks that go compiler directive comments (//go:) are valid. [fast: true, auto-fix: false]\ngochecknoglobals: check that no global variables exist [fast: false, auto-fix: false]\ngochecknoinits: Checks that no init functions are present in Go code [fast: true, auto-fix: false]\ngochecksumtype: Run exhaustiveness checks on Go \"sum types\" [fast: false, auto-fix: false]\ngocognit: Computes and checks the cognitive complexity of functions [fast: true, auto-fix: false]\ngoconst: Finds repeated strings that could be replaced by a constant [fast: true, auto-fix: false]\ngocritic: Provides diagnostics that check for bugs, performance and style issues. [fast: false, auto-fix: false]\ngocyclo: Computes and checks the cyclomatic complexity of functions [fast: true, auto-fix: false]\ngodot: Check if comments end in a period [fast: true, auto-fix: true]\ngodox: Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]\ngoerr113: Go linter to check the errors handling expressions [fast: false, auto-fix: false]\ngofmt: Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]\ngofumpt: Gofumpt checks whether code was gofumpt-ed. [fast: true, auto-fix: true]\ngoheader: Checks is file header matches to pattern [fast: true, auto-fix: false]\ngoimports: Check import statements are formatted according to the 'goimport' command. Reformat imports in autofix mode. [fast: true, auto-fix: true]\ngolint [deprecated]: Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: false, auto-fix: false]\ngomnd: An analyzer to detect magic numbers. [fast: true, auto-fix: false]\ngomoddirectives: Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. [fast: true, auto-fix: false]\ngomodguard: Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. [fast: true, auto-fix: false]\ngoprintffuncname: Checks that printf-like functions are named with `f` at the end. [fast: true, auto-fix: false]\ngosec (gas): Inspects source code for security problems [fast: false, auto-fix: false]\ngosmopolitan: Report certain i18n/l10n anti-patterns in your Go codebase [fast: false, auto-fix: false]\ngrouper: Analyze expression groups. [fast: true, auto-fix: false]\nifshort [deprecated]: Checks that your code uses short syntax for if-statements whenever possible. [fast: true, auto-fix: false]\nimportas: Enforces consistent import aliases [fast: false, auto-fix: false]\ninamedparam: reports interfaces with unnamed method parameters [fast: true, auto-fix: false]\ninterfacebloat: A linter that checks the number of methods inside an interface. [fast: true, auto-fix: false]\ninterfacer [deprecated]: Linter that suggests narrower interface types [fast: false, auto-fix: false]\nireturn: Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false]\nlll: Reports long lines [fast: true, auto-fix: false]\nloggercheck (logrlint): Checks key value pairs for common logger libraries (kitlog,klog,logr,zap). [fast: false, auto-fix: false]\nmaintidx: maintidx measures the maintainability index of each function. [fast: true, auto-fix: false]\nmakezero: Finds slice declarations with non-zero initial length [fast: false, auto-fix: false]\nmaligned [deprecated]: Tool to detect Go structs that would take less memory if their fields were sorted [fast: false, auto-fix: false]\nmirror: reports wrong mirror patterns of bytes/strings usage [fast: false, auto-fix: false]\nmisspell: Finds commonly misspelled English words [fast: true, auto-fix: true]\nmusttag: enforce field tags in (un)marshaled structs [fast: false, auto-fix: false]\nnakedret: Checks that functions with naked returns are not longer than a maximum size (can be zero). [fast: true, auto-fix: false]\nnestif: Reports deeply nested if statements [fast: true, auto-fix: false]\nnilerr: Finds the code that returns nil even if it checks that the error is not nil. [fast: false, auto-fix: false]\nnilnil: Checks that there is no simultaneous return of `nil` error and an invalid value. [fast: false, auto-fix: false]\nnlreturn: nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false]\nnoctx: Finds sending http request without context.Context [fast: false, auto-fix: false]\nnolintlint: Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false]\nnonamedreturns: Reports all named returns [fast: false, auto-fix: false]\nnosnakecase [deprecated]: nosnakecase is a linter that detects snake case of variable naming and function name. [fast: true, auto-fix: false]\nnosprintfhostport: Checks for misuse of Sprintf to construct a host with port in a URL. [fast: true, auto-fix: false]\nparalleltest: Detects missing usage of t.Parallel() method in your Go test [fast: false, auto-fix: false]\nperfsprint: Checks that fmt.Sprintf can be replaced with a faster alternative. [fast: false, auto-fix: false]\nprealloc: Finds slice declarations that could potentially be pre-allocated [fast: true, auto-fix: false]\npredeclared: find code that shadows one of Go's predeclared identifiers [fast: true, auto-fix: false]\npromlinter: Check Prometheus metrics naming via promlint [fast: true, auto-fix: false]\nprotogetter: Reports direct reads from proto message fields when getters should be used [fast: false, auto-fix: true]\nreassign: Checks that package variables are not reassigned [fast: false, auto-fix: false]\nrevive: Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false]\nrowserrcheck: checks whether Rows.Err of rows is checked successfully [fast: false, auto-fix: false]\nscopelint [deprecated]: Scopelint checks for unpinned variables in go programs [fast: true, auto-fix: false]\nsloglint: ensure consistent code style when using log/slog [fast: false, auto-fix: false]\nspancheck: Checks for mistakes with OpenTelemetry/Census spans. [fast: false, auto-fix: false]\nsqlclosecheck: Checks that sql.Rows, sql.Stmt, sqlx.NamedStmt, pgx.Query are closed. [fast: false, auto-fix: false]\nstructcheck [deprecated]: Finds unused struct fields [fast: false, auto-fix: false]\nstylecheck: Stylecheck is a replacement for golint [fast: false, auto-fix: false]\ntagalign: check that struct tags are well aligned [fast: true, auto-fix: true]\ntagliatelle: Checks the struct tags. [fast: true, auto-fix: false]\ntenv: tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 [fast: false, auto-fix: false]\ntestableexamples: linter checks if examples are testable (have an expected output) [fast: true, auto-fix: false]\ntestifylint: Checks usage of github.com/stretchr/testify. [fast: false, auto-fix: false]\ntestpackage: linter that makes you use a separate _test package [fast: true, auto-fix: false]\nthelper: thelper detects tests helpers which is not start with t.Helper() method. [fast: false, auto-fix: false]\ntparallel: tparallel detects inappropriate usage of t.Parallel() method in your Go test codes. [fast: false, auto-fix: false]\nunconvert: Remove unnecessary type conversions [fast: false, auto-fix: false]\nunparam: Reports unused function parameters [fast: false, auto-fix: false]\nusestdlibvars: A linter that detect the possibility to use variables/constants from the Go standard library. [fast: true, auto-fix: false]\nvarcheck [deprecated]: Finds unused global variables and constants [fast: false, auto-fix: false]\nvarnamelen: checks that the length of a variable's name matches its scope [fast: false, auto-fix: false]\nwastedassign: Finds wasted assignment statements [fast: false, auto-fix: false]\nwhitespace: Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc. [fast: true, auto-fix: true]\nwrapcheck: Checks that errors returned from external packages are wrapped [fast: false, auto-fix: false]\nwsl: add or remove empty lines [fast: true, auto-fix: false]\nzerologlint: Detects the wrong usage of `zerolog` that a user forgets to dispatch with `Send` or `Msg` [fast: false, auto-fix: false]",
|
|
"help": "Usage:\n golangci-lint run [flags]\n\nFlags:\n -c, --config PATH Read config from file path PATH\n --no-config Don't read config file\n --out-format string Format of output: colored-line-number|line-number|json|tab|checkstyle|code-climate|html|junit-xml|github-actions|teamcity (default \"colored-line-number\")\n --print-issued-lines Print lines of code with issue (default true)\n --print-linter-name Print linter name in issue line (default true)\n --uniq-by-line Make issues output unique by line (default true)\n --sort-results Sort linter results\n --path-prefix string Path prefix to add to output\n --modules-download-mode string Modules download mode. If not empty, passed as -mod=\u003cmode\u003e to go tools\n --issues-exit-code int Exit code when issues were found (default 1)\n --go string Targeted Go version\n --build-tags strings Build tags\n --timeout duration Timeout for total work (default 1m0s)\n --tests Analyze tests (*_test.go) (default true)\n --print-resources-usage Print avg and max memory usage of golangci-lint and total time\n --skip-dirs strings Regexps of directories to skip\n --skip-dirs-use-default Use or not use default excluded directories:\n - (^|/)vendor($|/)\n - (^|/)third_party($|/)\n - (^|/)testdata($|/)\n - (^|/)examples($|/)\n - (^|/)Godeps($|/)\n - (^|/)builtin($|/)\n (default true)\n --skip-files strings Regexps of files to skip\n --allow-parallel-runners Allow multiple parallel golangci-lint instances running. If false (default) - golangci-lint acquires file lock on start.\n --allow-serial-runners Allow multiple golangci-lint instances running, but serialize them around a lock. If false (default) - golangci-lint exits with an error if it fails to acquire file lock on start.\n --show-stats Show statistics per linter\n -D, --disable strings Disable specific linter\n --disable-all Disable all linters\n -E, --enable strings Enable specific linter\n --enable-all Enable all linters\n --fast Enable only fast linters from enabled linters set (first run won't be fast)\n -p, --presets strings Enable presets (bugs|comment|complexity|error|format|import|metalinter|module|performance|sql|style|test|unused) of linters. Run 'golangci-lint help linters' to see them. This option implies option --disable-all\n -e, --exclude strings Exclude issue by regexp\n --exclude-use-default Use or not use default excludes:\n # EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok\n - Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*print(f|ln)?|os\\.(Un)?Setenv). is not checked\n \n # EXC0002 golint: Annoying issue about not having a comment. The rare codebase has such comments\n - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)\n \n # EXC0003 golint: False positive when tests are defined in package 'test'\n - func name will be used as test\\.Test.* by other packages, and that stutters; consider calling this\n \n # EXC0004 govet: Common false positives\n - (possible misuse of unsafe.Pointer|should have signature)\n \n # EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore\n - ineffective break statement. Did you mean to break out of the outer loop\n \n # EXC0006 gosec: Too many false-positives on 'unsafe' usage\n - Use of unsafe calls should be audited\n \n # EXC0007 gosec: Too many false-positives for parametrized shell calls\n - Subprocess launch(ed with variable|ing should be audited)\n \n # EXC0008 gosec: Duplicated errcheck checks\n - (G104)\n \n # EXC0009 gosec: Too many issues in popular repos\n - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)\n \n # EXC0010 gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'\n - Potential file inclusion via variable\n \n # EXC0011 stylecheck: Annoying issue about not having a comment. The rare codebase has such comments\n - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)\n \n # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments\n - exported (.+) should have comment( \\(or a comment on this block\\))? or be unexported\n \n # EXC0013 revive: Annoying issue about not having a comment. The rare codebase has such comments\n - package comment should be of the form \"(.+)...\n \n # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comments\n - comment on exported (.+) should be of the form \"(.+)...\"\n \n # EXC0015 revive: Annoying issue about not having a comment. The rare codebase has such comments\n - should have a package comment\n (default true)\n --exclude-case-sensitive If set to true exclude and exclude rules regular expressions are case sensitive\n --max-issues-per-linter int Maximum issues count per one linter. Set to 0 to disable (default 50)\n --max-same-issues int Maximum count of issues with the same text. Set to 0 to disable (default 3)\n -n, --new Show only new issues: if there are unstaged changes or untracked files, only those changes are analyzed, else only changes in HEAD~ are analyzed.\n It's a super-useful option for integration of golangci-lint into existing large codebase.\n It's not practical to fix all existing issues at the moment of integration: much better to not allow issues in new code.\n For CI setups, prefer --new-from-rev=HEAD~, as --new can skip linting the current patch if any scripts generate unstaged files before golangci-lint runs.\n --new-from-rev REV Show only new issues created after git revision REV\n --new-from-patch PATH Show only new issues created in git patch with file path PATH\n --whole-files Show issues in any part of update files (requires new-from-rev or new-from-patch)\n --fix Fix found issues (if it's supported by the linter)\n -h, --help help for run\n\nGlobal Flags:\n --color string Use color when printing; can be 'always', 'auto', or 'never' (default \"auto\")\n -j, --concurrency int Number of CPUs to use (Default: number of logical CPUs) (default 8)\n --cpu-profile-path string Path to CPU profile output file\n --mem-profile-path string Path to memory profile output file\n --trace-path string Path to trace output file\n -v, --verbose Verbose output\n --version Print version\n"
|
|
}
|