JavaScript: Classify files with names ending in `_min` as minified.

We already do the same for `-min` and `.min`. [Here](https://github.com/antoniogarrote/rdfstore-js/blob/master/dist/rdfstore_min.js) is a real-world example.
This commit is contained in:
Max Schaefer 2019-11-06 09:06:39 +00:00
Родитель 717490b670
Коммит e314869e5c
6 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -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** |

Просмотреть файл

@ -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

Просмотреть файл

@ -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 |

Просмотреть файл

Просмотреть файл

Просмотреть файл