github.com/PDOK/gokoala@v0.50.6/.golangci.yaml (about)

     1  ---
     2  run:
     3    # Timeout for analysis.
     4    timeout: 5m
     5  
     6    # Modules download mode (do not modify go.mod)
     7    module-download-mode: readonly
     8  
     9    # Include test files (see below to exclude certain linters)
    10    tests: true
    11  
    12  issues:
    13    exclude-rules:
    14      # Exclude certain linters for test code
    15      - path: "_test\\.go"
    16        linters:
    17          - bodyclose
    18          - dupl
    19          - funlen
    20  
    21  output:
    22    format: colored-line-number
    23    print-issued-lines: true
    24    print-linter-name: true
    25  
    26  linters-settings:
    27    depguard:
    28      rules:
    29        main:
    30          # Packages that are not allowed where the value is a suggestion.
    31          deny:
    32            - pkg: "github.com/pkg/errors"
    33              desc: Should be replaced by standard lib errors package
    34    cyclop:
    35      # The maximal code complexity to report.
    36      max-complexity: 15
    37      skip-tests: true
    38    funlen:
    39      lines: 100
    40    nestif:
    41      min-complexity: 6
    42    forbidigo:
    43      forbid:
    44        - http\.NotFound.*  # return RFC 7807 problem details instead
    45        - http\.Error.*  # return RFC 7807 problem details instead
    46  
    47  linters:
    48    disable-all: true
    49    enable:
    50      # enabled by default by golangci-lint
    51      - errcheck  # checking for unchecked errors, these unchecked errors can be critical bugs in some cases
    52      - gosimple  # specializes in simplifying a code
    53      - govet  # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
    54      - ineffassign  # detects when assignments to existing variables are not used
    55      - staticcheck  # is a go vet on steroids, applying a ton of static analysis checks
    56      - typecheck  # like the front-end of a Go compiler, parses and type-checks Go code
    57      - unused  # checks for unused constants, variables, functions and types
    58      # extra enabled by us
    59      - asasalint  # checks for pass []any as any in variadic func(...any)
    60      - asciicheck  # checks that your code does not contain non-ASCII identifiers
    61      - bidichk  # checks for dangerous unicode character sequences
    62      - bodyclose  # checks whether HTTP response body is closed successfully
    63      - cyclop  # checks function and package cyclomatic complexity
    64      - dupl  # tool for code clone detection
    65      - durationcheck  # checks for two durations multiplied together
    66      - errname  # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
    67      - errorlint  # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
    68      - execinquery  # checks query string in Query function which reads your Go src files and warning it finds
    69      - exhaustive  # checks exhaustiveness of enum switch statements
    70      - exportloopref  # checks for pointers to enclosing loop variables
    71      - forbidigo  # forbids identifiers
    72      - funlen  # tool for detection of long functions
    73      - gocheckcompilerdirectives  # validates go compiler directive comments (//go:)
    74      - goconst  # finds repeated strings that could be replaced by a constant
    75      - gocritic  # provides diagnostics that check for bugs, performance and style issues
    76      - goimports  # in addition to fixing imports, goimports also formats your code in the same style as gofmt
    77      - gomoddirectives  # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod
    78      - gomodguard  # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations
    79      - goprintffuncname  # checks that printf-like functions are named with f at the end
    80      - gosec  # inspects source code for security problems
    81      - loggercheck  # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
    82      - makezero  # finds slice declarations with non-zero initial length
    83      - nakedret  # finds naked returns in functions greater than a specified function length
    84      - nestif  # reports deeply nested if statements
    85      - nilerr  # finds the code that returns nil even if it checks that the error is not nil
    86      - nolintlint  # reports ill-formed or insufficient nolint directives
    87      - nosprintfhostport  # checks for misuse of Sprintf to construct a host with port in a URL
    88      - perfsprint  # Golang linter for performance, aiming at usages of fmt.Sprintf which have faster alternatives
    89      - predeclared  # finds code that shadows one of Go's predeclared identifiers
    90      - promlinter  # checks Prometheus metrics naming via promlint
    91      - reassign  # checks that package variables are not reassigned
    92      - revive  # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint
    93      - rowserrcheck  # checks whether Err of rows is checked successfully
    94      - sqlclosecheck  # checks that sql.Rows and sql.Stmt are closed
    95      - sloglint  # A Go linter that ensures consistent code style when using log/slog
    96      - tenv  # detects using os.Setenv instead of t.Setenv since Go1.17
    97      - testableexamples  # checks if examples are testable (have an expected output)
    98      - tparallel  # detects inappropriate usage of t.Parallel() method in your Go test codes
    99      - unconvert  # removes unnecessary type conversions
   100      - unparam  # reports unused function parameters
   101      - usestdlibvars  # detects the possibility to use variables/constants from the Go standard library
   102      - wastedassign  # finds wasted assignment statements
   103    fast: false