Skip to content

Commit 08861af

Browse files
authored
feat: add listMode to depguard for golangci-lint (#3464)
1 parent f6f8c9a commit 08861af

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/schemas/json/golangci-lint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,12 @@
695695
"additionalProperties": false,
696696
"type": "object",
697697
"properties": {
698+
"listMode": {
699+
"description": "Used to determine the package matching priority.\nThere are three different modes: `original`, `strict`, and `lax`.\nDefault: \"original\"",
700+
"type": "string",
701+
"enum": ["original", "strict", "lax"],
702+
"default": "original"
703+
},
698704
"files": {
699705
"description": "List of file globs that will match this list of settings to compare against.",
700706
"additionalProperties": false,

src/test/golangci-lint/example-values.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@
335335
"depguard": {
336336
"rules": {
337337
"main": {
338-
"files": ["!**/*_a _file.go"],
338+
"listMode": "strict",
339+
"files": ["$all", "!**/*_a _file.go"],
339340
"allow": ["$gostd", "github.com/OpenPeeDeeP"],
340341
"deny": [
341342
{
@@ -347,6 +348,16 @@
347348
"desc": "Should be replaced by standard lib errors package"
348349
}
349350
]
351+
},
352+
"tests": {
353+
"listMode": "lax",
354+
"files": ["$test"],
355+
"deny": [
356+
{
357+
"pkg": "github.com/stretchr/testify",
358+
"desc": "Please use standard library for tests"
359+
}
360+
]
350361
}
351362
}
352363
},

0 commit comments

Comments
 (0)