Skip to content

Commit a295dfd

Browse files
author
Esben Sparre Andreasen
committed
JS: support AutoRest classification
1 parent a4b3b1e commit a295dfd

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

javascript/ql/src/semmle/javascript/GeneratedCode.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class CodeGeneratorMarkerComment extends GeneratedCodeMarkerComment {
4242
*/
4343
private predicate codeGeneratorMarkerComment(Comment c, string tool) {
4444
exists (string toolPattern |
45-
toolPattern = "js_of_ocaml|CoffeeScript|LiveScript|dart2js|ANTLR|PEG\\.js|Opal|JSX|jison(?:-lex)?" and
46-
tool = c.getText().regexpCapture("(?s)[\\s*]*(?:parser )?[gG]eneratedy? (?:from .*)?by (" + toolPattern + ")\\b.*", 1)
45+
toolPattern = "js_of_ocaml|CoffeeScript|LiveScript|dart2js|ANTLR|PEG\\.js|Opal|JSX|jison(?:-lex)?|(?:Microsoft \\(R\\) AutoRest Code Generator)" and
46+
tool = c.getText().regexpCapture("(?s)[\\s*]*(?:parser |Code )?[gG]eneratedy? (?:from .*)?by (" + toolPattern + ")\\b.*", 1)
4747
)
4848
}
4949

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
* Code generated by Microsoft (R) AutoRest Code Generator.
3+
* Changes may cause incorrect behavior and will be lost if the code is
4+
* regenerated.
5+
*/

javascript/ql/test/query-tests/filters/ClassifyFiles/ClassifyFiles.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
| AutoRest.js:0:0:0:0 | AutoRest.js | generated |
12
| ai.1.2.3-build0123.js:0:0:0:0 | ai.1.2.3-build0123.js | library |
23
| bundle-directive.js:0:0:0:0 | bundle-directive.js | generated |
34
| data.js:0:0:0:0 | data.js | generated |

javascript/ql/test/query-tests/filters/ClassifyFiles/CodeGenerator.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
| AutoRest.js:1:1:5:3 | /*\\n * C ... ed.\\n */ | Microsoft (R) AutoRest Code Generator |
12
| jison-lex.js:1:1:1:34 | /* gene ... .2.1 */ | jison-lex |
23
| jison.js:1:1:1:38 | /* pars ... 4.13 */ | jison |
34
| jsx-old.js:1:1:1:106 | // gene ... 977102) | JSX |

0 commit comments

Comments
 (0)