Python: Disallow examples

This commit is contained in:
Rasmus Wriedt Larsen
2023-11-02 18:17:50 +01:00
parent a20f06f8e0
commit bf7af7876c

View File

@@ -113,7 +113,8 @@ module NotExposed {
predicate isAllowedModule(Module mod) {
// don't include anything found in site-packages
exists(mod.getFile().getRelativePath())
exists(mod.getFile().getRelativePath()) and
not mod.getFile().getRelativePath().regexpMatch("(?i)(^|/)examples?/.*")
}
predicate isTestCode(AstNode ast) {