Skip to content

Commit 8c7bf69

Browse files
committed
allow raw db types in upgrade/downgrade scripts without adding a warning for it
1 parent 2b6d57d commit 8c7bf69

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ql/ql/src/queries/style/DBTypeInNonLib.ql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010

1111
import ql
1212

13+
/** Gets a folder that may contain raw DB types. */
14+
string folderWithDbTypes() { result = ["lib", "downgrades", "upgrades"] }
15+
1316
from TypeExpr te
1417
where
1518
te.isDBType() and
16-
not te.getLocation().getFile().getAbsolutePath().matches("%/lib/%") and
19+
not te.getLocation().getFile().getAbsolutePath().matches("%/" + folderWithDbTypes() + "/%") and
1720
exists(File f | f.getAbsolutePath().matches("%/lib/%")) and
1821
// it is needed in one case.
1922
not te = any(Class c | c.getName() = "SuppressionScope").getASuperType() and

0 commit comments

Comments
 (0)