diff options
author | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-02-15 12:02:40 +0300 |
---|---|---|
committer | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-03-01 06:44:13 +0300 |
commit | d1c74493afa2742170563993bd3cec7d646d4336 (patch) | |
tree | ba1ed3e6f444da88d5e9afd59c7c6c7fd05c486b /.golangci.yml | |
parent | 68e1031dedd145e03668f2179fe82b69f90adfeb (diff) |
Add golangci-lint custom linter infrastructure
This commit adds the infrastructure to support custom linters.
Unfortunately, golangci-lint doesn't support dynamic linter. It means
that we need to compile each linter with `-buildmode=plugin` flag. The
compiled artifacts are then configured in `.golangci.yml` file. New
linter implementation follows the guide in this lint:
https://golangci-lint.run/contributing/new-linters/
Implementing this linter requires the following steps:
* Add analyzers implemting the checks to tools/gitaly-linters package
* Add the new checks to `lint.go` file
* Re-compile via `make gitaly-linters` or `make lint`
Diffstat (limited to '.golangci.yml')
-rw-r--r-- | .golangci.yml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/.golangci.yml b/.golangci.yml index 747e64a03..b9f6aa32b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -135,6 +135,11 @@ linters-settings: begin: false tb: begin: false + custom: + gitaly-linters: + path: ./_build/tools/gitaly-linters.so + description: A collection of linters tailored for Gitaly + original-url: gitlab.com/gitlab-org/gitaly issues: exclude-use-default: false |