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 <bircni@icloud.com>
Reviewed-on: https://gitea.com/gitea/runner/pulls/1303
Reviewed-by: Zettat123 <39446+zettat123@noreply.gitea.com>
This commit is contained in:
Lunny Xiao
2026-10-12 03:39:48 +00:00
parent 4e8037a93b
commit 8502663d0e

View File

@@ -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