Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4843062 commit 2343dbdCopy full SHA for 2343dbd
scripts/rules.go
@@ -134,6 +134,16 @@ func databaseImport(m dsl.Matcher) {
134
Where(m.File().PkgPath.Matches("github.com/coder/coder/v2/codersdk"))
135
}
136
137
+// sdkImportFromDB enforces not importing any /codersdk from /database.
138
+//
139
+//nolint:unused,deadcode,varnamelen
140
+func sdkImportFromDB(m dsl.Matcher) {
141
+ m.Import("github.com/coder/coder/v2/codersdk")
142
+ m.Match("codersdk.$_").
143
+ Report("Do not import any codersdk types into database").
144
+ Where(m.File().PkgPath.Matches("github.com/coder/coder/v2/coderd/database"))
145
+}
146
+
147
// doNotCallTFailNowInsideGoroutine enforces not calling t.FailNow or
148
// functions that may themselves call t.FailNow in goroutines outside
149
// the main test goroutine. See testing.go:834 for why.
0 commit comments