Skip to content

Commit 67963a5

Browse files
authored
Merge pull request #2258 from asger-semmle/js-ignore-codesql-databases
Approved by esbena
2 parents 0862004 + 812ee34 commit 67963a5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,9 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
666666
throws IOException {
667667
if (!dir.equals(currentRoot[0]) && (excludes.contains(dir) || dir.toFile().isHidden()))
668668
return FileVisitResult.SKIP_SUBTREE;
669+
if (Files.exists(dir.resolve("codeql-database.yml"))) {
670+
return FileVisitResult.SKIP_SUBTREE;
671+
}
669672
return super.preVisitDirectory(dir, attrs);
670673
}
671674
};

javascript/extractor/src/com/semmle/js/extractor/test/AutoBuildTests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,4 +585,12 @@ public void qhelpAsXmlAndAllXml() throws IOException {
585585
addFile(true, LGTM_SRC, "tst.qhelp");
586586
runTest();
587587
}
588+
589+
@Test
590+
public void skipCodeQLDatabases() throws IOException {
591+
addFile(true, LGTM_SRC, "tst.js");
592+
addFile(false, LGTM_SRC, "db/codeql-database.yml");
593+
addFile(false, LGTM_SRC, "db/foo.js");
594+
runTest();
595+
}
588596
}

0 commit comments

Comments
 (0)