diff options
author | Karthik Nayak <knayak@gitlab.com> | 2022-12-15 13:26:28 +0300 |
---|---|---|
committer | Karthik Nayak <knayak@gitlab.com> | 2022-12-16 16:37:28 +0300 |
commit | dc1525bbc6d44aac9473491fe94c1436479d84ed (patch) | |
tree | e158de8dd605226835285fb61bc431f49c1dd8a1 /.golangci.yml | |
parent | 6db9504cadb903133eedbd388c679ffd1c6a8508 (diff) |
golangci: Add paralleltest to the list of linters
In the last few commits we reinitialized the test variable wherever
needed and also fixed tests. This is due to a bug/feature around how Go
treats looped
variables (https://gist.github.com/posener/92a55c4cd441fc5e5e85f27bca008721).
To avoid this mistake in the future, let's add a linter check around
this issue. This is done by adding the `paralleltest` linter. We also
enable `ignore-missing` because we don't want to complain about missing
usage of `t.Parallel()` (for now...).
Diffstat (limited to '.golangci.yml')
-rw-r--r-- | .golangci.yml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/.golangci.yml b/.golangci.yml index 635fc2299..747e64a03 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -27,6 +27,7 @@ linters: - misspell - noctx - nolintlint + - paralleltest - revive - staticcheck - stylecheck @@ -84,6 +85,9 @@ linters-settings: # checks to verify we don't use `t.Parallel()` when setting envvars. - ^os.Setenv$ - ^os.Unsetenv$ + paralleltest: + # Ignore missing calls to `t.Parallel()` and only report incorrect uses of it. + ignore-missing: true revive: # Specifying any rule explicitly will disable the default-enabled rules. # Manually specify the defaults along with `context-as-argument`. |