mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore(scripts/rules.go): ignore db imports in _test.go files (#20406)
This change allows us to stop adding the following for every invokation: ``` //nolint:gocritic // This is in a test package and does not end up in the build ```
This commit is contained in:
committed by
GitHub
parent
69c2c40512
commit
f64ac8f5f7
+4
-1
@@ -133,7 +133,10 @@ func databaseImport(m dsl.Matcher) {
|
||||
m.Import("github.com/coder/coder/v2/coderd/database")
|
||||
m.Match("database.$_").
|
||||
Report("Do not import any database types into codersdk").
|
||||
Where(m.File().PkgPath.Matches("github.com/coder/coder/v2/codersdk"))
|
||||
Where(
|
||||
m.File().PkgPath.Matches("github.com/coder/coder/v2/codersdk") &&
|
||||
!m.File().Name.Matches(`_test\.go$`),
|
||||
)
|
||||
}
|
||||
|
||||
// publishInTransaction detects calls to Publish inside database transactions
|
||||
|
||||
Reference in New Issue
Block a user