github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/cli/.golangci.yml (about) 1 linters: 2 enable: 3 - bodyclose 4 - dogsled 5 - gocyclo 6 - goimports 7 - gosec 8 - gosimple 9 - govet 10 - ineffassign 11 - lll 12 - megacheck 13 - misspell 14 - nakedret 15 - revive 16 - staticcheck 17 - typecheck 18 - unconvert 19 - unparam 20 - unused 21 22 disable: 23 - errcheck 24 25 run: 26 timeout: 5m 27 skip-dirs: 28 - cli/command/stack/kubernetes/api/openapi 29 - cli/command/stack/kubernetes/api/client 30 skip-files: 31 - cli/compose/schema/bindata.go 32 - .*generated.* 33 34 linters-settings: 35 gocyclo: 36 min-complexity: 16 37 govet: 38 check-shadowing: false 39 lll: 40 line-length: 200 41 nakedret: 42 command: nakedret 43 pattern: ^(?P<path>.*?\\.go):(?P<line>\\d+)\\s*(?P<message>.*)$ 44 45 issues: 46 # The default exclusion rules are a bit too permissive, so copying the relevant ones below 47 exclude-use-default: false 48 49 exclude: 50 - parameter .* always receives 51 52 exclude-rules: 53 # We prefer to use an "exclude-list" so that new "default" exclusions are not 54 # automatically inherited. We can decide whether or not to follow upstream 55 # defaults when updating golang-ci-lint versions. 56 # Unfortunately, this means we have to copy the whole exclusion pattern, as 57 # (unlike the "include" option), the "exclude" option does not take exclusion 58 # ID's. 59 # 60 # These exclusion patterns are copied from the default excluses at: 61 # https://github.com/golangci/golangci-lint/blob/v1.44.0/pkg/config/issues.go#L10-L104 62 63 # EXC0001 64 - text: "Error return value of .((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|.*print(f|ln)?|os\\.(Un)?Setenv). is not checked" 65 linters: 66 - errcheck 67 # EXC0003 68 - text: "func name will be used as test\\.Test.* by other packages, and that stutters; consider calling this" 69 linters: 70 - revive 71 # EXC0006 72 - text: "Use of unsafe calls should be audited" 73 linters: 74 - gosec 75 # EXC0007 76 - text: "Subprocess launch(ed with variable|ing should be audited)" 77 linters: 78 - gosec 79 # EXC0008 80 # TODO: evaluate these and fix where needed: G307: Deferring unsafe method "*os.File" on type "Close" (gosec) 81 - text: "(G104|G307)" 82 linters: 83 - gosec 84 # EXC0009 85 - text: "(Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)" 86 linters: 87 - gosec 88 # EXC0010 89 - text: "Potential file inclusion via variable" 90 linters: 91 - gosec 92 93 # G113 Potential uncontrolled memory consumption in Rat.SetString (CVE-2022-23772) 94 # only affects gp < 1.16.14. and go < 1.17.7 95 - text: "(G113)" 96 linters: 97 - gosec 98 99 # Looks like the match in "EXC0007" above doesn't catch this one 100 # TODO: consider upstreaming this to golangci-lint's default exclusion rules 101 - text: "G204: Subprocess launched with a potential tainted input or cmd arguments" 102 linters: 103 - gosec 104 # Looks like the match in "EXC0009" above doesn't catch this one 105 # TODO: consider upstreaming this to golangci-lint's default exclusion rules 106 - text: "G306: Expect WriteFile permissions to be 0600 or less" 107 linters: 108 - gosec 109 110 # TODO: make sure all packages have a description. Currently, there's 67 packages without. 111 - text: "package-comments: should have a package comment" 112 linters: 113 - revive 114 115 # Exclude some linters from running on tests files. 116 - path: _test\.go 117 linters: 118 - errcheck 119 - gosec 120 121 # Fixing these lints would change user-facing output, which would be 122 # undesirable to introduce in a patch release. 123 - text: "ST1005: error strings should not be capitalized" 124 linters: 125 - stylecheck 126 127 # Maximum issues count per one linter. Set to 0 to disable. Default is 50. 128 max-issues-per-linter: 0 129 130 # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. 131 max-same-issues: 0