From 8502663d0e6a5954b39cb7ca3cb967655b318b29 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 12 Oct 2026 03:39:48 +0000 Subject: [PATCH] chore(lint): forbid importing logrus outside the logging package (#1303) Add a `depguard` rule so everything logs through `act/common/logging`, which keeps the backend swappable. Stacked on https://gitea.com/gitea/runner/pulls/1302. Assisted-by: Codet Co-authored-by: bircni Reviewed-on: https://gitea.com/gitea/runner/pulls/1303 Reviewed-by: Zettat123 <39446+zettat123@noreply.gitea.com> --- .golangci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 29a2d61e..4ec18eda 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -39,6 +39,13 @@ linters: deny: - pkg: golang.org/x/exp desc: it's experimental and unreliable + logrus: + files: + - $all + - "!**/act/common/logging/**" + deny: + - pkg: github.com/sirupsen/logrus + desc: log through gitea.com/gitea/runner/act/common/logging nolintlint: allow-unused: false require-explanation: true