Skip to content

Commit 2d71294

Browse files
authored
Merge pull request #15256 from sidshank/change/adjust-extracted-files-diagnostics
Js/Py/Rb: Report any extracted file as successfully extracted
2 parents 3ae4848 + 2c683c9 commit 2d71294

File tree

9 files changed

+27
-17
lines changed

9 files changed

+27
-17
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The diagnostic query `js/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned JavaScript and TypeScript files, now considers any JavaScript and TypeScript file seen during extraction, even one with some errors, to be extracted / scanned.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name Successfully extracted files
3-
* @description Lists all files in the source code directory that were extracted without encountering an error in the file.
2+
* @name Extracted files
3+
* @description Lists all files in the source code directory that were extracted.
44
* @kind diagnostic
55
* @id js/diagnostics/successfully-extracted-files
66
* @tags successfully-extracted-files
@@ -9,7 +9,5 @@
99
import javascript
1010

1111
from File f
12-
where
13-
not exists(Error e | e.isFatal() and e.getFile() = f) and
14-
exists(f.getRelativePath())
12+
where exists(f.getRelativePath())
1513
select f, ""

javascript/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
| bad1.js:0:0:0:0 | bad1.js | |
2+
| bad2.ts:0:0:0:0 | bad2.ts | |
3+
| bad3.html:0:0:0:0 | bad3.html | |
14
| contains-template.js:0:0:0:0 | contains-template.js | |
25
| good1.js:0:0:0:0 | good1.js | |
36
| good2.ts:0:0:0:0 | good2.ts | |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The diagnostic query `py/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned Python files, now considers any Python file seen during extraction, even one with some errors, to be extracted / scanned.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
2-
* @name Successfully extracted Python files
3-
* @description Lists all Python files in the source code directory that were extracted
4-
* without encountering an error.
2+
* @name Extracted Python files
3+
* @description Lists all Python files in the source code directory that were extracted.
54
* @kind diagnostic
65
* @id py/diagnostics/successfully-extracted-files
76
* @tags successfully-extracted-files
@@ -10,7 +9,5 @@
109
import python
1110

1211
from File file
13-
where
14-
not exists(SyntaxError e | e.getFile() = file) and
15-
exists(file.getRelativePath())
12+
where exists(file.getRelativePath())
1613
select file, ""
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
| bad_encoding.py:0:0:0:0 | bad_encoding.py | |
12
| good_file.py:0:0:0:0 | good_file.py | |
3+
| syntax_error.py:0:0:0:0 | syntax_error.py | |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The diagnostic query `rb/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned Ruby files, now considers any Ruby file seen during extraction, even one with some errors, to be extracted / scanned.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
2-
* @name Successfully extracted files
3-
* @description Lists all files in the source code directory that were extracted
4-
* without encountering an error in the file.
2+
* @name Extracted files
3+
* @description Lists all files in the source code directory that were extracted.
54
* @kind diagnostic
65
* @id rb/diagnostics/successfully-extracted-files
76
* @tags successfully-extracted-files
@@ -11,7 +10,5 @@ import codeql.ruby.AST
1110
import codeql.ruby.Diagnostics
1211

1312
from File f
14-
where
15-
not exists(ExtractionError e | e.getLocation().getFile() = f) and
16-
exists(f.getRelativePath())
13+
where exists(f.getRelativePath())
1714
select f, ""
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
| src/bar.erb:0:0:0:0 | src/bar.erb | |
22
| src/foo.rb:0:0:0:0 | src/foo.rb | |
3+
| src/not_ruby.rb:0:0:0:0 | src/not_ruby.rb | |
34
| src/vendor/cache/lib.rb:0:0:0:0 | src/vendor/cache/lib.rb | |

0 commit comments

Comments
 (0)