|
|
|
|
@ -1,38 +1,20 @@ |
|
|
|
|
version: "2" |
|
|
|
|
# Configuration for how we run golangci-lint |
|
|
|
|
# Timeout of 5m was the default in v1. |
|
|
|
|
run: |
|
|
|
|
timeout: 5m |
|
|
|
|
linters: |
|
|
|
|
# Don't enable any linters by default; just the ones that we explicitly |
|
|
|
|
# enable in the list below. |
|
|
|
|
disable-all: true |
|
|
|
|
default: none |
|
|
|
|
enable: |
|
|
|
|
- bidichk |
|
|
|
|
- gofmt |
|
|
|
|
- goimports |
|
|
|
|
- govet |
|
|
|
|
- misspell |
|
|
|
|
- revive |
|
|
|
|
|
|
|
|
|
# Configuration for how we run golangci-lint |
|
|
|
|
run: |
|
|
|
|
timeout: 5m |
|
|
|
|
|
|
|
|
|
issues: |
|
|
|
|
# Excluding configuration per-path, per-linter, per-text and per-source |
|
|
|
|
exclude-rules: |
|
|
|
|
# These are forks of an upstream package and thus are exempt from stylistic |
|
|
|
|
# changes that would make pulling in upstream changes harder. |
|
|
|
|
- path: tempfork/.*\.go |
|
|
|
|
text: "File is not `gofmt`-ed with `-s` `-r 'interface{} -> any'`" |
|
|
|
|
- path: util/singleflight/.*\.go |
|
|
|
|
text: "File is not `gofmt`-ed with `-s` `-r 'interface{} -> any'`" |
|
|
|
|
|
|
|
|
|
# Per-linter settings are contained in this top-level key |
|
|
|
|
linters-settings: |
|
|
|
|
gofmt: |
|
|
|
|
rewrite-rules: |
|
|
|
|
- pattern: 'interface{}' |
|
|
|
|
replacement: 'any' |
|
|
|
|
|
|
|
|
|
govet: |
|
|
|
|
settings: |
|
|
|
|
# Matches what we use in corp as of 2023-12-07 |
|
|
|
|
govet: |
|
|
|
|
enable: |
|
|
|
|
- asmdecl |
|
|
|
|
- assign |
|
|
|
|
@ -72,10 +54,8 @@ linters-settings: |
|
|
|
|
# NOTE(andrew-d): this doesn't currently work because the printf |
|
|
|
|
# analyzer doesn't support type declarations |
|
|
|
|
#- github.com/tailscale/tailscale/types/logger.Logf |
|
|
|
|
|
|
|
|
|
revive: |
|
|
|
|
enable-all-rules: false |
|
|
|
|
ignore-generated-header: true |
|
|
|
|
rules: |
|
|
|
|
- name: atomic |
|
|
|
|
- name: context-keys-type |
|
|
|
|
@ -95,3 +75,36 @@ linters-settings: |
|
|
|
|
- name: unconditional-recursion |
|
|
|
|
- name: useless-break |
|
|
|
|
- name: waitgroup-by-value |
|
|
|
|
exclusions: |
|
|
|
|
generated: lax |
|
|
|
|
presets: |
|
|
|
|
- comments |
|
|
|
|
- common-false-positives |
|
|
|
|
- legacy |
|
|
|
|
- std-error-handling |
|
|
|
|
rules: |
|
|
|
|
# These are forks of an upstream package and thus are exempt from stylistic |
|
|
|
|
# changes that would make pulling in upstream changes harder. |
|
|
|
|
- path: tempfork/.*\.go |
|
|
|
|
text: File is not `gofmt`-ed with `-s` `-r 'interface{} -> any'` |
|
|
|
|
- path: util/singleflight/.*\.go |
|
|
|
|
text: File is not `gofmt`-ed with `-s` `-r 'interface{} -> any'` |
|
|
|
|
paths: |
|
|
|
|
- third_party$ |
|
|
|
|
- builtin$ |
|
|
|
|
- examples$ |
|
|
|
|
formatters: |
|
|
|
|
enable: |
|
|
|
|
- gofmt |
|
|
|
|
- goimports |
|
|
|
|
settings: |
|
|
|
|
gofmt: |
|
|
|
|
rewrite-rules: |
|
|
|
|
- pattern: interface{} |
|
|
|
|
replacement: any |
|
|
|
|
exclusions: |
|
|
|
|
generated: lax |
|
|
|
|
paths: |
|
|
|
|
- third_party$ |
|
|
|
|
- builtin$ |
|
|
|
|
- examples$ |
|
|
|
|
|