mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
280255acae
This adds an initial and intentionally minimal configuration for golang-ci, fixes the issues reported, and adds a GitHub Action to check new pull requests against this linter configuration. Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I8f38fbc315836a19a094d0d3e986758b9313f163
34 lines
898 B
YAML
34 lines
898 B
YAML
linters:
|
|
# Don't enable any linters by default; just the ones that we explicitly
|
|
# enable in the list below.
|
|
disable-all: true
|
|
enable:
|
|
- gofmt
|
|
- goimports
|
|
- misspell
|
|
|
|
# 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'
|
|
|
|
goimports:
|
|
|
|
misspell:
|