Merge pull request #2260 from max-schaefer/js/_min

JavaScript: Classify files with names ending in `_min` as minified.
This commit is contained in:
Esben Sparre Andreasen
2019-11-08 13:52:33 +01:00
committed by GitHub
6 changed files with 6 additions and 3 deletions

View File

@@ -2,6 +2,8 @@
## General improvements
* Automatic classification of generated and minified files has been improved, in particular files generated by Doxygen are now recognized.
* Support for `globalThis` has been added.
* Support for the following frameworks and libraries has been improved:
@@ -14,8 +16,6 @@
* TypeScript 3.6 and 3.7 features are now supported.
* Automatic classification of generated files has been improved, in particular files generated by Doxygen are now recognized.
## New queries
| **Query** | **Tags** | **Purpose** |

View File

@@ -150,7 +150,7 @@ class TopLevel extends @toplevel, StmtContainer {
/** Holds if this toplevel is minified. */
predicate isMinified() {
// file name contains 'min' (not as part of a longer word)
getFile().getBaseName().regexpMatch(".*[^-.]*[-.]min([-.].*)?\\.\\w+")
getFile().getBaseName().regexpMatch(".*[^-._]*[-._]min([-._].*)?\\.\\w+")
or
exists(int numstmt | numstmt = strictcount(Stmt s | s.getTopLevel() = this) |
// there are more than two statements per line on average

View File

@@ -39,8 +39,11 @@
| textmate.html:0:0:0:0 | textmate.html | generated |
| tmpl2.html:0:0:0:0 | tmpl2.html | template |
| tmpl.html:0:0:0:0 | tmpl.html | template |
| tst-min.js:0:0:0:0 | tst-min.js | generated |
| tst.browserify.js:0:0:0:0 | tst.browserify.js | generated |
| tst.dart.js:0:0:0:0 | tst.dart.js | generated |
| tst.min.js:0:0:0:0 | tst.min.js | generated |
| tst_min.js:0:0:0:0 | tst_min.js | generated |
| twitter-text.js:0:0:0:0 | twitter-text.js | library |
| twitter_text.js:0:0:0:0 | twitter_text.js | library |
| unannotated-externs-1.js:0:0:0:0 | unannotated-externs-1.js | externs |