diff --git a/change-notes/1.19/extractor-javascript.md b/change-notes/1.19/extractor-javascript.md index bff31271434..0ad335af0dc 100644 --- a/change-notes/1.19/extractor-javascript.md +++ b/change-notes/1.19/extractor-javascript.md @@ -16,8 +16,16 @@ ## General improvements -> Changes that affect alerts in many files or from many queries -> For example, changes to file classification +* On LGTM, files whose name ends in `.min.js` or `-min.js` are no longer extracted by default, since they most likely contain minified code and results in these files would be hidden by default anyway. To extract such files anyway, you can add the following filters to your `lgtm.yml` file (or add them to existing filters): + +```yaml +extraction: + javascript: + index: + filters: + - include: "**/*.min.js" + - include: "**/*-min.js" +``` ## Changes to code extraction diff --git a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java index c04db341407..16a0226321c 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java +++ b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java @@ -111,7 +111,7 @@ import com.semmle.util.trap.TrapWriter; * *
* The filtering phase is parameterised by a list of include/exclude patterns in the style of
- * {@link ProjectLayout} specifications. There are some built-in include patterns discussed
+ * {@link ProjectLayout} specifications. There are some built-in include/exclude patterns discussed
* below. Additionally, the environment variable LGTM_INDEX_FILTERS is interpreted
* as a newline-separated list of patterns to append to that list (hence taking precedence over
* the built-in patterns). Unlike for {@link ProjectLayout}, patterns in
@@ -140,6 +140,15 @@ import com.semmle.util.trap.TrapWriter;
*
+ * The default exclusion patterns cause the following files to be excluded: + *
+ *-min.js or .min.js.
+ * Such files typically contain minified code. Since LGTM by default does not show results
+ * in minified files, it is not usually worth extracting them in the first place.
* JavaScript files are normally extracted with {@link SourceType#AUTO}, but an explicit
* source type can be specified in the environment variable LGTM_INDEX_SOURCE_TYPE.
*