github.com/avfs/avfs@v0.33.1-0.20240303173310-c6ba67c33eb7/.golangci.yml (about) 1 run: 2 timeout: 1m 3 max-same-issues: 0 4 5 linters-settings: 6 dupl: 7 threshold: 100 8 funlen: 9 lines: 120 10 statements: 60 11 goconst: 12 min-len: 2 13 min-occurrences: 4 14 gocritic: 15 enabled-tags: 16 - diagnostic 17 - experimental 18 - opinionated 19 - performance 20 - style 21 disabled-checks: 22 - preferStringWriter 23 gomnd: 24 # don't include the "operation" and "assign" 25 checks: 26 - argument 27 - case 28 - condition 29 - return 30 ignored-numbers: 31 - '0' 32 - '1' 33 - '2' 34 - '3' 35 ignored-functions: 36 - strings.SplitN 37 govet: 38 check-shadowing: true 39 lll: 40 line-length: 140 41 misspell: 42 locale: US 43 revive: 44 rules: 45 - name: cyclomatic 46 severity: warning 47 arguments: [20] 48 - name: line-length-limit 49 severity: error 50 arguments: [140] 51 - name: unused-parameter 52 disabled: true 53 54 linters: 55 disable-all: true 56 enable: 57 - asasalint # check for pass []any as any in variadic func(...any) 58 - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers 59 - bidichk # Checks for dangerous unicode character sequences 60 - bodyclose # checks whether HTTP response body is closed successfully 61 - containedctx # containedctx is a linter that detects struct contained context.Context field 62 - contextcheck # check whether the function uses a non-inherited context 63 - decorder # check declaration order and count of types, constants, variables and functions 64 - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) 65 - durationcheck # check for two durations multiplied together 66 - dupword # checks for duplicate words in the source code 67 - errcheck # errcheck is a program for checking for unchecked errors in Go code. These unchecked errors can be critical bugs in some cases 68 - errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted. 69 - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. 70 - execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds 71 - exportloopref # checks for pointers to enclosing loop variables 72 - forbidigo # Forbids identifiers 73 - forcetypeassert # finds forced type assertions 74 - funlen # Tool for detection of long functions 75 - gci # Gci controls Go package import order and makes it always deterministic. 76 - ginkgolinter # enforces standards of using ginkgo and gomega 77 - gocheckcompilerdirectives # Checks that go compiler directive comments (//go:) are valid. 78 - gochecknoglobals # check that no global variables exist 79 - gochecknoinits # Checks that no init functions are present in Go code 80 - goconst # Finds repeated strings that could be replaced by a constant 81 - gocritic # Provides diagnostics that check for bugs, performance and style issues. 82 - godot # Check if comments end in a period 83 - godox # Tool for detection of FIXME, TODO and other comment keywords 84 - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification 85 - gofumpt # Gofumpt checks whether code was gofumpt-ed. 86 - goheader # Checks is file header matches to pattern 87 - goimports # Check import statements are formatted according to the 'goimport' command. Reformat imports in autofix mode. 88 - gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. 89 - gomodguard # 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. 90 - goprintffuncname # Checks that printf-like functions are named with `f` at the end 91 - gosimple # (megacheck): Linter for Go source code that specializes in simplifying code 92 - govet # (vet, vetshadow) Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string 93 - grouper # An analyzer to analyze expression groups. 94 - importas # Enforces consistent import aliases 95 - ineffassign # Detects when assignments to existing variables are not used 96 - loggercheck # (logrlint) Checks key value pairs for common logger libraries (kitlog,klog,logr,zap). 97 - makezero # Finds slice declarations with non-zero initial length 98 - maintidx # maintidx measures the maintainability index of each function. 99 - misspell # Finds commonly misspelled English words in comments 100 - musttag # enforce field tags in (un)marshaled structs 101 - nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value. 102 - nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity 103 - noctx # noctx finds sending http request without context.Context 104 - nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL. 105 - nolintlint # Reports ill-formed or insufficient nolint directives 106 - prealloc # Finds slice declarations that could potentially be pre-allocated 107 - predeclared # find code that shadows one of Go's predeclared identifiers 108 - promlinter # Check Prometheus metrics naming via promlint 109 - reassign # Checks that package variables are not reassigned 110 - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. 111 - rowserrcheck # checks whether Err of rows is checked successfully 112 - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. 113 - staticcheck # (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. 114 - stylecheck # Stylecheck is a replacement for golint 115 - tagalign # check that struct tags are well aligned 116 - tagliatelle # Checks the struct tags. 117 - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 118 - testableexamples # linter checks if examples are testable (have an expected output) 119 - testpackage # linter that makes you use a separate _test package 120 - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes 121 - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code 122 - unconvert # Remove unnecessary type conversions 123 - unparam # Reports unused function parameters 124 - unused # (megacheck) Checks Go code for unused constants, variables, functions and types 125 - usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library. 126 - wastedassign # wastedassign finds wasted assignment statements. 127 - whitespace # Tool for detection of leading and trailing whitespace 128 - wsl # Whitespace Linter - Forces you to use empty lines! 129 130 #- cyclop # checks function and package cyclomatic complexity 131 #- depguard # Go linter that checks if package imports are in a list of acceptable packages 132 #- dupl # Tool for code clone detection 133 #- errorlint # 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. 134 #- exhaustive # check exhaustiveness of enum switch statements 135 #- exhaustruct # Checks if all structure fields are initialized 136 #- gocognit # Computes and checks the cognitive complexity of functions 137 #- gocyclo # Computes and checks the cyclomatic complexity of functions 138 #- goerr113 # Go linter to check the errors handling expressions 139 #- gomnd # An analyzer to detect magic numbers. 140 #- gosec # (gas): Inspects source code for security problems 141 #- interfacebloat # A linter that checks the number of methods inside an interface. 142 #- ireturn # Accept Interfaces, Return Concrete Types 143 #- lll # Reports long lines 144 #- nakedret # Finds naked returns in functions greater than a specified function length 145 #- nestif # Reports deeply nested if statements 146 #- nilerr # Finds the code that returns nil even if it checks that the error is not nil. 147 #- nonamedreturns # Reports all named returns 148 #- paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test 149 #- thelper # thelper detects Go test helpers without t.Helper() call and checks the consistency of test helpers 150 #- varnamelen # checks that the length of a variable's name matches its scope 151 #- wrapcheck # Checks that errors returned from external packages are wrapped 152 153 issues: 154 # Excluding configuration per-path, per-linter, per-text and per-source 155 exclude-rules: 156 - text: ".*id.* should be .*ID.*" 157 linters: 158 - revive 159 - stylecheck 160 - text: "Line contains TODO/BUG/FIXME" 161 linters: 162 - godox 163 - path: "test" 164 text: "cyclomatic:" 165 linters: 166 - revive 167 - path: "test" 168 linters: 169 - dogsled 170 - dupl 171 - funlen 172 - goconst 173 - gocritic 174 - gomnd 175 - maintidx