|
| 1 | +run: |
| 2 | + timeout: 5m |
| 3 | +linters: |
| 4 | + enable: |
| 5 | + # region General |
| 6 | + |
| 7 | + # Add depguard to prevent adding additional dependencies. This is a client library, we really don't want |
| 8 | + # additional dependencies. |
| 9 | + - depguard |
| 10 | + # Prevent improper directives in go.mod. |
| 11 | + - gomoddirectives |
| 12 | + # Prevent improper nolint directives. |
| 13 | + - nolintlint |
| 14 | + |
| 15 | + # endregion |
| 16 | + |
| 17 | + |
| 18 | + # region Code Quality and Comments |
| 19 | + |
| 20 | + # Inspect source code for potential security problems. This check has a fairly high false positive rate, |
| 21 | + # comment with // nolint:gosec where not relevant. |
| 22 | + - gosec |
| 23 | + # Replace golint. |
| 24 | + # - revive |
| 25 | + # Complain about deeply nested if cases. |
| 26 | + - nestif |
| 27 | + # Prevent naked returns in long functions. |
| 28 | + - nakedret |
| 29 | + # Make Go code more readable. |
| 30 | +# - gocritic |
| 31 | + # Check if comments end in a period. This helps prevent incomplete comment lines, such as half-written sentences. |
| 32 | + # - godot |
| 33 | + # Complain about comments as these indicate incomplete code. |
| 34 | + - godox |
| 35 | + # Keep the cyclomatic complexity of functions to a reasonable level. |
| 36 | + - gocyclo |
| 37 | + # Complain about cognitive complexity of functions. |
| 38 | + - gocognit |
| 39 | + # Find repeated strings that could be converted into constants. |
| 40 | +# - goconst |
| 41 | + # Complain about unnecessary type conversions. |
| 42 | + - unconvert |
| 43 | + # Complain about unused parameters. These should be replaced with underscores. |
| 44 | + - unparam |
| 45 | + # Check for non-ASCII identifiers. |
| 46 | + - asciicheck |
| 47 | + # Check for HTTP response body being closed. Sometimes, you may need to disable this using // nolint:bodyclose. |
| 48 | + - bodyclose |
| 49 | + # Check for duplicate code. You may want to disable this with // nolint:dupl if the source code is the same, but |
| 50 | + # legitimately exists for different reasons. |
| 51 | + - dupl |
| 52 | + # Check for pointers in loops. This is a typical bug source. |
| 53 | + - exportloopref |
| 54 | + # Prevent dogsledding (mass-ignoring return values). This typically indicates missing error handling. |
| 55 | + - dogsled |
| 56 | + # Enforce consistent import aliases across all files. |
| 57 | + - importas |
| 58 | + # Make code properly formatted. |
| 59 | + - gofmt |
| 60 | + # Prevent faulty error checks. |
| 61 | + - nilerr |
| 62 | + # Prevent direct error checks that won't work with wrapped errors. |
| 63 | + - errorlint |
| 64 | + # Find slice usage that could potentially be preallocated. |
| 65 | + - prealloc |
| 66 | + # Check for improper duration handling. |
| 67 | + - durationcheck |
| 68 | + # Enforce tests being in the _test package. |
| 69 | + # - testpackage |
| 70 | + |
| 71 | + # endregion |
| 72 | +linters-settings: |
| 73 | + depguard: |
| 74 | + rules: |
| 75 | + main: |
| 76 | + list-mode: strict |
| 77 | + allow: |
| 78 | + - $gostd |
| 79 | + - go.flow.arcalot.io/ |
| 80 | + - go.arcalot.io/ |
| 81 | + - github.com/docker/ |
| 82 | + - github.com/opencontainers/ |
| 83 | + - gopkg.in/yaml.v3 |
| 84 | + - github.com/fxamacker/cbor |
| 85 | + - golang.org/ |
| 86 | + govet: |
| 87 | + enable-all: true |
| 88 | + check-shadowing: false |
| 89 | + disable: |
| 90 | + # We don't care about variable shadowing. |
| 91 | + - shadow |
| 92 | + - fieldalignment |
| 93 | + stylecheck: |
| 94 | + checks: |
| 95 | + - all |
| 96 | +issues: |
| 97 | + exclude-use-default: false |
0 commit comments