Skip to content

Commit 840fa09

Browse files
committed
Limit lockfile extraction to configured paths
Exclude lockfiles from JavaScript's default autobuild set so only explicitly included files such as Actions actions.lock are extracted. Ensure QL tests pass the lockfile to the extractor. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4994bb27-c5ca-47e9-b082-cfc1ca244e86
1 parent 5419f53 commit 840fa09

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
semmle-extractor-options: actions.lock

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
* <li>All HTML files, that is, files with with one of the extensions supported by {@link
156156
* FileType#HTML} (currently ".htm", ".html", ".xhtm", ".xhtml", ".vue", ".html.erb", ".html.dot", ".jsp").
157157
* <li>All YAML files, that is, files with one of the extensions supported by {@link
158-
* FileType#YAML} (currently ".lock", ".raml", ".yaml", ".yml").
158+
* FileType#YAML} (currently ".raml", ".yaml", ".yml").
159159
* <li>Files with base name "package.json" or "tsconfig.json", and files whose base name
160160
* is of the form "codeql-javascript-*.json".
161161
* <li>JavaScript, JSON or YAML files whose base name starts with ".eslintrc".
@@ -404,6 +404,9 @@ private void setupFilters() {
404404
patterns.add("**/*tsconfig*.json");
405405
patterns.add("**/codeql-javascript-*.json");
406406

407+
// exclude lock files that are not explicitly included via `LGTM_INDEX_FILTERS`
408+
patterns.add("-**/*.lock");
409+
407410
// include any explicitly specified extensions
408411
for (String extension : fileTypes.keySet()) patterns.add("**/*" + extension);
409412

javascript/resources/codeql-extractor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ file_types:
6666
display_name: Data or configuration files
6767
extensions:
6868
- .json
69-
- .lock
7069
- .yml
7170
- .yaml
7271
- .raml

0 commit comments

Comments
 (0)