From 0099ff5d263621030578fc5744e37a5d9dae11fb Mon Sep 17 00:00:00 2001 From: qwerty287 <80460567+qwerty287@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:18:14 +0100 Subject: [PATCH] Add linting for `log.Fatal()` (#2946) Closes https://github.com/woodpecker-ci/woodpecker/issues/1509 --- .golangci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index e2bec6801..0e15e6145 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,6 +13,7 @@ linters-settings: - context\.WithCancel$ - ^print.*$ - panic + - ^log.Fatal().*$ errorlint: errorf-multi: true @@ -48,7 +49,11 @@ issues: - staticcheck - revive - # let cli use print and panic + # let cli use print and panic and log.Fatal() - path: 'cmd/*|cli/*' linters: - forbidigo + # allow some setup functions to use log.Fatal() + - path: 'server/web/web.go|server/plugins/encryption/tink_keyset_watcher.go' + linters: + - forbidigo