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-21 14:05:46 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-08-21 14:59:45 +0300
commit50990937946c90314aea35ebb2495bd06d8ec21f (patch)
tree712468e4864ed76c88e695c13140687678dac3ae
parentd687fb7576ca0fc38e7abd173a267c489e5210e1 (diff)
golangci-lint: Update hints for forbidden logging statements
We have forbidden a bunch of different logging statements with the hint that clients should either use `log.Default()` or `ctxlogrus.Extract()`. The former is essentially deprecated though in favor of using injected loggers. Rephrase the hints to reflect that.
-rw-r--r--.golangci.yml8
1 files changed, 4 insertions, 4 deletions
diff --git a/.golangci.yml b/.golangci.yml
index db6e94145..263d274e7 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -71,13 +71,13 @@ linters-settings:
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()`.
+ msg: Use an injected logger or `ctxlogrus.Extract()`.
- p: ^logrus\.StandardLogger$
- msg: Use the logger provided by `log.Default()` or `ctxlogrus.Extract()`.
+ msg: Use an injected logger or `ctxlogrus.Extract()`.
- p: ^logrus\.New$
- msg: Use the logger provided by `log.Default()` or `ctxlogrus.Extract()`.
+ msg: Use an injected logger or `ctxlogrus.Extract()`.
- p: ^logrus\.With(Context|Error|Field|Fields|Time)$
- msg: Use the logger provided by `log.Default()` or `ctxlogrus.Extract()`.
+ msg: Use an injected logger or `ctxlogrus.Extract()`.
analyze-types: true
paralleltest:
# Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.