diff options
author | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-06-21 11:30:21 +0300 |
---|---|---|
committer | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-06-26 14:36:49 +0300 |
commit | 7b5689f42873d3a13921b2c008359c599451ceac (patch) | |
tree | b38da8646e3d3b56d8ebc1ba2068ae272a2b882f /.golangci.yml | |
parent | 6ac87a72f42d764de827836a56c726e6d21ee96e (diff) |
Implement a linter to discourage future usage of Unavailable code
The prior commit fixes inelligible usages of Unavailable status codes.
To prevent this situation from happening in the future, this commit
implements a linter that it warns occurrences where Unavailable code is
used. Engineers can ignore it by adding a comment, but at least this
practice catches their eyes.
Diffstat (limited to '.golangci.yml')
-rw-r--r-- | .golangci.yml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/.golangci.yml b/.golangci.yml index c41e1df5d..aaca0828f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -144,6 +144,9 @@ linters-settings: included-functions: - fmt.Errorf - gitlab.com/gitlab-org/gitaly/v16/internal/structerr.* + unavailable_code: + included-functions: + - gitlab.com/gitlab-org/gitaly/v16/internal/structerr.NewUnavailable issues: exclude-use-default: false |