github.com/opiuman/genqlient@v1.0.0/.golangci.yml (about) 1 # For the full list of configuration options, see 2 # https://github.com/golangci/golangci-lint#config-file 3 4 # See more about these linters at https://golangci-lint.run/usage/linters/ 5 linters: 6 fast: false 7 disable-all: true 8 enable: 9 # golangci enables these by default. 10 - deadcode 11 - errcheck 12 - gofumpt # (replaces gofmt) 13 - gosimple 14 - govet 15 - ineffassign 16 - staticcheck 17 - structcheck 18 - typecheck 19 - unused 20 - varcheck 21 # golangci disables these by default, but we use them. 22 - bodyclose 23 - depguard 24 - durationcheck 25 - errorlint 26 - exportloopref 27 - gocritic 28 - nakedret 29 - stylecheck 30 - unconvert 31 - unparam 32 - whitespace 33 - forbidigo 34 35 linters-settings: 36 errcheck: 37 check-type-assertions: true # check for a := b.(T) 38 39 errorlint: 40 errorf: false # it's valid to use %v instead of %w 41 42 govet: 43 check-shadowing: true 44 enable-all: true 45 46 # We have a ton of test-only packages; but make sure we keep prod deps small. 47 depguard: 48 list-type: whitelist 49 packages: 50 - github.com/opiuman/genqlient 51 - github.com/vektah/gqlparser/v2 52 - golang.org/x/tools 53 - gopkg.in/yaml.v2 54 - github.com/alexflint/go-arg 55 56 forbidigo: 57 forbid: 58 - '^print(|f|ln)$' 59 - '^fmt\.Print(|f|ln)$' 60 61 62 gocritic: 63 # Which checks should be enabled: 64 # See https://go-critic.github.io/overview#checks-overview 65 # and https://github.com/go-critic/go-critic#usage -> section "Tags". 66 # To check which checks are enabled: `GL_DEBUG=gocritic golangci-lint run` 67 enabled-tags: 68 - diagnostic 69 - performance 70 - style 71 72 disabled-checks: 73 - builtinShadow 74 - commentedOutCode 75 - importShadow 76 - paramTypeCombine 77 - unnamedResult 78 - ifElseChain 79 - sloppyReassign 80 - typeDefFirst 81 82 settings: # settings passed to gocritic 83 captLocal: # must be valid enabled check name 84 paramsOnly: true 85 86 87 issues: 88 exclude-rules: 89 # Test-only deps are not restricted. 90 - linters: 91 - depguard 92 path: _test\.go$|^internal/testutil/|^internal/integration/ 93 94 # Ok to use fmt.Print in the examples, and in the CLI entrypoint. 95 - linters: 96 - forbidigo 97 path: ^example/|^generate/main\.go$ 98 99 - linters: 100 - errcheck 101 path: _test\.go$ 102 # Unchecked type-asserts are ok in tests -- a panic will be plenty clear. 103 # An error message with no function name means an unchecked type-assert. 104 text: "^Error return value is not checked$" 105 106 # Don't error if a test setup function always takes the same arguments. 107 - linters: 108 - unparam 109 path: _test\.go$ 110 111 - linters: 112 - govet 113 # Only a big deal for runtime code. 114 path: ^generate/|^example/ 115 text: "^fieldalignment: struct with \\d+ pointer bytes could be \\d+$"