Python: Disallow examples

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

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) {