From ba2e88ee50c9c61ace2436fbc0893b77a2f23eab Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Sat, 17 Jun 2023 06:28:09 +0200 Subject: [PATCH] Update golangci-lint config * Migrate from Python codespell to golangci-lint misspell. * Inline errcheck exclude list in the golangci-lint config. Signed-off-by: Ben Kochie --- .circleci/config.yml | 11 ----------- .golangci.yml | 7 ++++++- scripts/codespell_ignore.txt | 6 ------ scripts/errcheck_excludes.txt | 4 ---- 4 files changed, 6 insertions(+), 22 deletions(-) delete mode 100644 scripts/codespell_ignore.txt delete mode 100644 scripts/errcheck_excludes.txt diff --git a/.circleci/config.yml b/.circleci/config.yml index 71e7946cf6..d6e6b870ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,13 +28,6 @@ jobs: - checkout - run: uname -a - run: make test-e2e - codespell: - docker: - - image: circleci/python - steps: - - checkout - - run: sudo pip install codespell - - run: codespell --skip=".git,./vendor,ttar,go.mod,go.sum,*pem,./collector/fixtures" -I scripts/codespell_ignore.txt test_mixins: executor: golang steps: @@ -105,10 +98,6 @@ workflows: filters: tags: only: /.*/ - - codespell: - filters: - tags: - only: /.*/ - test_docker: requires: - test diff --git a/.golangci.yml b/.golangci.yml index 0412d93b82..bc18dcc3fc 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,6 @@ linters: enable: + - misspell - revive disable: # Disable soon to deprecated[1] linters that lead to false @@ -19,4 +20,8 @@ issues: linters-settings: errcheck: - exclude: scripts/errcheck_excludes.txt + exclude-functions: + # Used in HTTP handlers, any error is handled by the server itself. + - (net/http.ResponseWriter).Write + # Never check for logger errors. + - (github.com/go-kit/log.Logger).Log diff --git a/scripts/codespell_ignore.txt b/scripts/codespell_ignore.txt deleted file mode 100644 index 1253e6fed1..0000000000 --- a/scripts/codespell_ignore.txt +++ /dev/null @@ -1,6 +0,0 @@ -inflight -packages\' -ro -siz -uint -uptodate diff --git a/scripts/errcheck_excludes.txt b/scripts/errcheck_excludes.txt deleted file mode 100644 index 14b824f85f..0000000000 --- a/scripts/errcheck_excludes.txt +++ /dev/null @@ -1,4 +0,0 @@ -// Used in HTTP handlers, any error is handled by the server itself. -(net/http.ResponseWriter).Write -// Never check for logger errors. -(github.com/go-kit/log.Logger).Log