|
| 1 | +linters: |
| 2 | + disable-all: true |
| 3 | + enable: |
| 4 | + # (TODO) uncomment after fixing the lint issues |
| 5 | + # - gofmt |
| 6 | + - govet |
| 7 | + # - unconvert |
| 8 | + # - staticcheck |
| 9 | + # - ineffassign |
| 10 | + # - unparam |
| 11 | + - forbidigo |
| 12 | + |
| 13 | +issues: |
| 14 | + # Disable the default exclude list so that all excludes are explicitly |
| 15 | + # defined in this file. |
| 16 | + exclude-use-default: false |
| 17 | + |
| 18 | + exclude-rules: |
| 19 | + # Temp Ignore SA9004: only the first constant in this group has an explicit type |
| 20 | + # https://staticcheck.io/docs/checks#SA9004 |
| 21 | + - linters: [staticcheck] |
| 22 | + text: 'SA9004:' |
| 23 | + |
| 24 | + - linters: [staticcheck] |
| 25 | + text: 'SA1019: Package github.com/golang/protobuf/jsonpb is deprecated' |
| 26 | + |
| 27 | + - linters: [staticcheck] |
| 28 | + text: 'SA1019: Package github.com/golang/protobuf/proto is deprecated' |
| 29 | + |
| 30 | + - linters: [staticcheck] |
| 31 | + text: 'SA1019: ptypes.MarshalAny is deprecated' |
| 32 | + |
| 33 | + - linters: [staticcheck] |
| 34 | + text: 'SA1019: ptypes.UnmarshalAny is deprecated' |
| 35 | + |
| 36 | + - linters: [staticcheck] |
| 37 | + text: 'SA1019: package github.com/golang/protobuf/ptypes is deprecated' |
| 38 | + |
| 39 | + # An argument that always receives the same value is often not a problem. |
| 40 | + - linters: [unparam] |
| 41 | + text: 'always receives' |
| 42 | + |
| 43 | + # Often functions will implement an interface that returns an error without |
| 44 | + # needing to return an error. Sometimes the error return value is unnecessary |
| 45 | + # but a linter can not tell the difference. |
| 46 | + - linters: [unparam] |
| 47 | + text: 'result \d+ \(error\) is always nil' |
| 48 | + |
| 49 | + # Allow unused parameters to start with an underscore. Arguments with a name |
| 50 | + # of '_' are already ignored. |
| 51 | + # Ignoring longer names that start with underscore allow for better |
| 52 | + # self-documentation than a single underscore by itself. Underscore arguments |
| 53 | + # should generally only be used when a function is implementing an interface. |
| 54 | + - linters: [unparam] |
| 55 | + text: '`_[^`]*` is unused' |
| 56 | + |
| 57 | + # Temp ignore some common unused parameters so that unparam can be added |
| 58 | + # incrementally. |
| 59 | + - linters: [unparam] |
| 60 | + text: '`(t|resp|req|entMeta)` is unused' |
| 61 | + |
| 62 | +linters-settings: |
| 63 | + gofmt: |
| 64 | + simplify: true |
| 65 | + forbidigo: |
| 66 | + # Forbid the following identifiers (list of regexp). |
| 67 | + forbid: |
| 68 | + - '\brequire\.New\b(# Use package-level functions with explicit TestingT)?' |
| 69 | + - '\bassert\.New\b(# Use package-level functions with explicit TestingT)?' |
| 70 | + - '\bmetrics\.IncrCounter\b(# Use labeled metrics)?' |
| 71 | + - '\bmetrics\.AddSample\b(# Use labeled metrics)?' |
| 72 | + - '\bmetrics\.MeasureSince\b(# Use labeled metrics)?' |
| 73 | + - '\bmetrics\.SetGauge\b(# Use labeled metrics)?' |
| 74 | + # Exclude godoc examples from forbidigo checks. |
| 75 | + # Default: true |
| 76 | + exclude_godoc_examples: false |
| 77 | + |
| 78 | +run: |
| 79 | + timeout: 10m |
| 80 | + concurrency: 4 |
0 commit comments