github.com/Serizao/go-winio@v0.0.0-20230906082528-f02f7f4ad6e8/.golangci.yml (about)

     1  run:
     2    skip-dirs:
     3      - pkg/etw/sample
     4  
     5  linters:
     6    enable:
     7      # style
     8      - containedctx # struct contains a context
     9      - dupl # duplicate code
    10      - errname # erorrs are named correctly
    11      - nolintlint # "//nolint" directives are properly explained
    12      - revive # golint replacement
    13      - unconvert # unnecessary conversions
    14      - wastedassign
    15  
    16      # bugs, performance, unused, etc ...
    17      - contextcheck # function uses a non-inherited context
    18      - errorlint # errors not wrapped for 1.13
    19      - exhaustive # check exhaustiveness of enum switch statements
    20      - gofmt # files are gofmt'ed
    21      - gosec # security
    22      - nilerr # returns nil even with non-nil error
    23      - thelper #  test helpers without t.Helper()
    24      - unparam # unused function params
    25  
    26  issues:
    27    exclude-rules:
    28      # err is very often shadowed in nested scopes
    29      - linters:
    30          - govet
    31        text: '^shadow: declaration of "err" shadows declaration'
    32  
    33      # ignore long lines for skip autogen directives
    34      - linters:
    35          - revive
    36        text: "^line-length-limit: "
    37        source: "^//(go:generate|sys) "
    38  
    39      #TODO: remove after upgrading to go1.18
    40      # ignore comment spacing for nolint and sys directives
    41      - linters:
    42          - revive
    43        text: "^comment-spacings: no space between comment delimiter and comment text"
    44        source: "//(cspell:|nolint:|sys |todo)"
    45  
    46      # not on go 1.18 yet, so no any
    47      - linters:
    48          - revive
    49        text: "^use-any: since GO 1.18 'interface{}' can be replaced by 'any'"
    50  
    51      # allow unjustified ignores of error checks in defer statements
    52      - linters:
    53          - nolintlint
    54        text: "^directive `//nolint:errcheck` should provide explanation"
    55        source: '^\s*defer '
    56  
    57      # allow unjustified ignores of error lints for io.EOF
    58      - linters:
    59          - nolintlint
    60        text: "^directive `//nolint:errorlint` should provide explanation"
    61        source: '[=|!]= io.EOF'
    62  
    63  
    64  linters-settings:
    65    exhaustive:
    66      default-signifies-exhaustive: true
    67    govet:
    68      enable-all: true
    69      disable:
    70        # struct order is often for Win32 compat
    71        # also, ignore pointer bytes/GC issues for now until performance becomes an issue
    72        - fieldalignment
    73      check-shadowing: true
    74    nolintlint:
    75      allow-leading-space: false
    76      require-explanation: true
    77      require-specific: true
    78    revive:
    79      # revive is more configurable than static check, so likely the preferred alternative to static-check
    80      # (once the perf issue is solved: https://github.com/golangci/golangci-lint/issues/2997)
    81      enable-all-rules:
    82        true
    83        # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
    84      rules:
    85        # rules with required arguments
    86        - name: argument-limit
    87          disabled: true
    88        - name: banned-characters
    89          disabled: true
    90        - name: cognitive-complexity
    91          disabled: true
    92        - name: cyclomatic
    93          disabled: true
    94        - name: file-header
    95          disabled: true
    96        - name: function-length
    97          disabled: true
    98        - name: function-result-limit
    99          disabled: true
   100        - name: max-public-structs
   101          disabled: true
   102        # geneally annoying rules
   103        - name: add-constant # complains about any and all strings and integers
   104          disabled: true
   105        - name: confusing-naming # we frequently use "Foo()" and "foo()" together
   106          disabled: true
   107        - name: flag-parameter # excessive, and a common idiom we use
   108          disabled: true
   109        - name: unhandled-error # warns over common fmt.Print* and io.Close; rely on errcheck instead
   110          disabled: true
   111        # general config
   112        - name: line-length-limit
   113          arguments:
   114            - 140
   115        - name: var-naming
   116          arguments:
   117            - []
   118            - - CID
   119              - CRI
   120              - CTRD
   121              - DACL
   122              - DLL
   123              - DOS
   124              - ETW
   125              - FSCTL
   126              - GCS
   127              - GMSA
   128              - HCS
   129              - HV
   130              - IO
   131              - LCOW
   132              - LDAP
   133              - LPAC
   134              - LTSC
   135              - MMIO
   136              - NT
   137              - OCI
   138              - PMEM
   139              - PWSH
   140              - RX
   141              - SACl
   142              - SID
   143              - SMB
   144              - TX
   145              - VHD
   146              - VHDX
   147              - VMID
   148              - VPCI
   149              - WCOW
   150              - WIM