Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-01-19 02:39:05 +0300
committerÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-01-21 18:58:36 +0300
commitce3f2ee42249b5497ed165337bef2c58e1026d75 (patch)
treeba4f7811c90bf4040068631a235b42cd8768eca5 /.golangci-strict.yml
parent8bc144134170cde66ce62fadf2fbd9993bb3fb5c (diff)
Lint: split up "make lint" and "make lint-strict" configs
Take a different approach than 20ef26439 (golangci: Enable error and documentation linters, 2020-12-17) did and get rid of "new-from-rev" entirely. Instead we have config for "make lint-strict" which isn't passing yet, and the main config for "make lint" which'll cause a CI failure. After looking a bit into how "new-from-rev" works I think using it is just a fundamentally bad idea in our case. All we want is to phase-in new lints, which we can just do better like this with a new config. To figure out what lines to complain about since "b7d42677f" it has to run: git diff --relative b7d42677f Which currently takes ~200ms for me, but that relatively short time is because it's ~300 commits ago. If we take something ~3000 commits ago (early 2020, so not that long) like "1e3d3131f" it's going to take ~3 seconds, and worse we're starting to run into the default diff.renameLimit there, so the diff will suddenly get much worse. So the whole thing is a ticking timebomb in behavior & gradual slowdown waiting to happen.
Diffstat (limited to '.golangci-strict.yml')
-rw-r--r--.golangci-strict.yml30
1 files changed, 30 insertions, 0 deletions
diff --git a/.golangci-strict.yml b/.golangci-strict.yml
new file mode 100644
index 000000000..610efbe32
--- /dev/null
+++ b/.golangci-strict.yml
@@ -0,0 +1,30 @@
+# options for analysis running
+run:
+ # timeout for analysis, e.g. 30s, 5m, default is 1m
+ timeout: 5m
+ modules-download-mode: readonly
+
+# list of useful linters could be found at https://github.com/golangci/awesome-go-linters
+linters:
+ disable-all: true
+ enable:
+ - errcheck
+ - errorlint
+ - golint
+
+issues:
+ exclude-use-default: false
+ # Excluding configuration per-path, per-linter, per-text and per-source
+ exclude-rules:
+ - linters:
+ - errcheck
+ path: "_test.go"
+ text: "Error return value of `(cc|con(ns?)?|db|closer|lis(tener)?).Close` is not checked"
+ - linters:
+ - golint
+ path: "_test.go"
+ text: "context.Context should be the first parameter of a function"
+ # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
+ max-issues-per-linter: 0
+ # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
+ max-same-issues: 0