github.com/hzck/speedroute@v0.0.0-20201115191102-403b7d0e443f/.golangci.yml (about)

     1  # Based on golangci-lint settings 
     2  linters-settings:
     3    dupl:
     4      threshold: 100
     5    exhaustive:
     6      default-signifies-exhaustive: false
     7    funlen:
     8      lines: 100
     9      statements: 50
    10    goconst:
    11      min-len: 2
    12      min-occurrences: 2
    13    gocritic:
    14      enabled-tags:
    15        - diagnostic
    16        - experimental
    17        - opinionated
    18        - performance
    19        - style
    20      disabled-checks:
    21        - dupImport # https://github.com/go-critic/go-critic/issues/845
    22        - ifElseChain
    23        - octalLiteral
    24        - whyNoLint
    25        - wrapperFunc
    26    gocyclo:
    27      min-complexity: 15
    28    goimports:
    29      local-prefixes: github.com/hzck/speedroute
    30    golint:
    31      min-confidence: 0
    32    gomnd:
    33      settings:
    34        mnd:
    35          # don't include the "operation" and "assign"
    36          checks: argument,case,condition,return
    37    govet:
    38      check-shadowing: true
    39    lll:
    40      line-length: 140
    41    maligned:
    42      suggest-new: true
    43    misspell:
    44      locale: US
    45    nolintlint:
    46      allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
    47      allow-unused: false # report any unused nolint directives
    48      require-explanation: false # don't require an explanation for nolint directives
    49      require-specific: false # don't require nolint directives to be specific about which linter is being skipped
    50  
    51  linters:
    52    # please, do not use `enable-all`: it's deprecated and will be removed soon.
    53    # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
    54    disable-all: true
    55    enable:
    56      - bodyclose
    57      - deadcode
    58      - depguard
    59      - dogsled
    60      - dupl
    61      - errcheck
    62      - funlen
    63      - gochecknoinits
    64      - goconst
    65      - gocritic
    66      - gocyclo
    67      - gofmt
    68      - goimports
    69      - golint
    70      - gomnd
    71      - goprintffuncname
    72      - gosec
    73      - gosimple
    74      - govet
    75      - ineffassign
    76      - lll
    77      - misspell
    78      - nakedret
    79      - nolintlint
    80      - rowserrcheck
    81      - scopelint
    82      - staticcheck
    83      - structcheck
    84      - stylecheck
    85      - typecheck
    86      - unconvert
    87      - unparam
    88      - unused
    89      - varcheck
    90      - whitespace
    91  
    92    # don't enable:
    93    # - asciicheck
    94    # - exhaustive
    95    # - gochecknoglobals
    96    # - gocognit
    97    # - godot
    98    # - godox
    99    # - goerr113
   100    # - interfacer
   101    # - maligned
   102    # - nestif
   103    # - noctx
   104    # - prealloc
   105    # - testpackage
   106    # - wsl
   107  
   108  issues:
   109    # Excluding configuration per-path, per-linter, per-text and per-source
   110    exclude-rules:
   111      - path: _test\.go
   112        linters:
   113          - gomnd
   114  
   115      # https://github.com/go-critic/go-critic/issues/926
   116      - linters:
   117          - gocritic
   118        text: "unnecessaryDefer:"
   119  
   120  run:
   121    skip-dirs:
   122      - test/testdata_etc
   123      - internal/cache
   124      - internal/renameio
   125      - internal/robustio
   126  
   127  # golangci.com configuration
   128  # https://github.com/golangci/golangci/wiki/Configuration
   129  service:
   130    golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly
   131    prepare:
   132      - echo "here I can run custom commands, but no preparation needed for this repo"