Skip to content

Commit 9d46cfe

Browse files
committed
lint: fix linting rules for logrus
The regexp should only match *symbols*, so we need to remove the opening bracket of the function call. Additionally, we need to use anchors to match the whole string, so as to not break on logrus.TraceLevel and similar. Finally, the error message is reworded to also mention bklog.L. Signed-off-by: Justin Chadwell <[email protected]>
1 parent 0074631 commit 9d46cfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ linters-settings:
3939
forbidigo:
4040
forbid:
4141
- '^fmt\.Errorf(# use errors\.Errorf instead)?$'
42-
- 'logrus\.(Trace|Debug|Info|Warn|Warning|Error|Fatal)(f|ln)?\((# use bklog\.G\(ctx\) instead of logrus directly)?'
42+
- '^logrus\.(Trace|Debug|Info|Warn|Warning|Error|Fatal)(f|ln)?(# use bklog\.G or bklog\.L instead of logrus directly)?$'
4343
importas:
4444
alias:
4545
- pkg: "github.com/opencontainers/image-spec/specs-go/v1"

0 commit comments

Comments
 (0)