Skip to content

Commit

Permalink
Add tests to main configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Will Dixon <[email protected]>
  • Loading branch information
dixonwille committed Oct 9, 2023
1 parent e9b5e24 commit c909ff4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions cmd/depguard/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ var testfiles embed.FS

var expectedConfigStruct = &depguard.LinterSettings{
"main": &depguard.List{
Files: []string{"$all", "!$test"},
Allow: []string{"$gostd", "github.com/"},
ListMode: "Strict",
Files: []string{"$all", "!$test"},
Allow: []string{"$gostd", "github.com/"},
Deny: map[string]string{
"reflect": "Who needs reflection",
"github.com/OpenPeeDeeP": "Use Something Else",
Expand Down
3 changes: 2 additions & 1 deletion cmd/depguard/testfiles/.depguard.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"$all",
"!$test"
],
"listMode": "Strict",
"allow": [
"$gostd",
"github.com/"
Expand All @@ -24,4 +25,4 @@
"github.com/OpenPeeDeeP/": "Use Something Else"
}
}
}
}
3 changes: 2 additions & 1 deletion cmd/depguard/testfiles/.depguard.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ files = [
"$all",
"!$test"
]
listMode = "Strict"
allow = [
"$gostd",
"github.com/"
Expand All @@ -19,4 +20,4 @@ allow = [
"github.com/test"
]
[tests.deny]
"github.com/OpenPeeDeeP/" = "Use Something Else"
"github.com/OpenPeeDeeP/" = "Use Something Else"
3 changes: 2 additions & 1 deletion cmd/depguard/testfiles/.depguard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ main:
files:
- "$all"
- "!$test"
listMode: Strict
allow:
- "$gostd"
- github.com/
Expand All @@ -14,4 +15,4 @@ tests:
allow:
- github.com/test
deny:
github.com/OpenPeeDeeP/: Use Something Else
github.com/OpenPeeDeeP/: Use Something Else

0 comments on commit c909ff4

Please sign in to comment.