Skip to content

Commit

Permalink
nogo: Add a test to exercise base configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
DolceTriade committed Dec 2, 2022
1 parent 53113f1 commit 093bff5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/core/nogo/custom/custom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,24 @@ func run(pass *analysis.Pass) (interface{}, error) {
}
}
-- baseconfig.json --
{
"_base": {
"exclude_files": {
"has_.*\\.go": "Visibility analyzer not specified. Still inherits this special exception."
}
},
"importfmt": {
"only_files": {
"has_errors\\.go": ""
}
},
"foofuncname": {
"description": "no exemptions since we know this check is 100% accurate, so override base config",
"exclude_files": {}
}
}
-- has_errors.go --
package haserrors
Expand Down Expand Up @@ -418,6 +436,18 @@ func Test(t *testing.T) {
excludes: []string{
`importfmt`,
},
}, {
desc: "custom_config_with_base_linedirective",
config: "baseconfig.json",
target: "//:has_errors_linedirective",
wantSuccess: false,
includes: []string{
`linedirective_foofuncname.go:.*function must not be named Foo \(foofuncname\)`,
`linedirective_visibility.go:.*function D is not visible in this package \(visibility\)`,
},
excludes: []string{
`importfmt`,
},
}, {
desc: "uses_cgo_with_errors",
config: "config.json",
Expand Down

0 comments on commit 093bff5

Please sign in to comment.