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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2023-08-11 12:59:09 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-08-15 08:19:22 +0300
commit9b2c13df769467811da5e1b958daac59262aa999 (patch)
treec2cf71ae883a07c38ec90d4cb81301044fcef9fd /.golangci.yml
parent23de79a6461d2e0285d14db58e6051c77b735ca9 (diff)
golangci-lint: Forbid use of standard logrus logger
Forbid the use of the standard logrus logger in favor of using our own logger accessible via the `internal/log` package.
Diffstat (limited to '.golangci.yml')
-rw-r--r--.golangci.yml8
1 files changed, 8 insertions, 0 deletions
diff --git a/.golangci.yml b/.golangci.yml
index 0d2832821..80720509c 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -13,6 +13,7 @@ linters:
- errcheck
- errname
- exportloopref
+ - forbidigo
- gci
- gitaly-linters
# We use both gofmt and gofumpt because gofumpt doesn't seem to be linting
@@ -67,6 +68,13 @@ linters-settings:
- (io.Closer).Close
- (net.Conn).Close
- (net.Listener).Close
+ forbidigo:
+ forbid:
+ - p: ^logrus\.(Debug,Error,Fatal,Info,Panic,Print,Trace,Warn,Warning)(f|ln)?$
+ msg: Use the logger provided by `log.Default()` or `ctxlogrus.Extract()`.
+ - p: ^logrus\.StandardLogger$
+ msg: Use the logger provided by `log.Default()` or `ctxlogrus.Extract()`.
+ analyze-types: true
paralleltest:
# Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.
ignore-missing: true