Skip to content

Commit 6ce8cd3

Browse files
committed
Python: Disallow examples
1 parent 6db3b37 commit 6ce8cd3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/ql/lib/semmle/python/frameworks/internal/SubclassFinder.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ module NotExposed {
113113

114114
predicate isAllowedModule(Module mod) {
115115
// don't include anything found in site-packages
116-
exists(mod.getFile().getRelativePath())
116+
exists(mod.getFile().getRelativePath()) and
117+
not mod.getFile().getRelativePath().regexpMatch("(?i)(^|/)examples?/.*")
117118
}
118119

119120
predicate isTestCode(AstNode ast) {

0 commit comments

Comments
 (0)