Skip to content

Commit d19ad49

Browse files
authored
Merge pull request github#15381 from geoffw0/cppfiles
C++: Report any extracted file as successfully extracted
2 parents 4602f89 + b125d2c commit d19ad49

17 files changed

+64
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
/**
2-
* @name Successfully extracted files
3-
* @description Lists all files in the source code directory that were extracted without encountering a problem 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 cpp/diagnostics/successfully-extracted-files
66
* @tags successfully-extracted-files
77
*/
88

99
import cpp
10-
import ExtractionProblems
1110

1211
from File f
13-
where
14-
not exists(ExtractionProblem e | e.getFile() = f) and
15-
exists(f.getRelativePath())
12+
where exists(f.getRelativePath()) and f.fromSource()
1613
select f, "File successfully extracted."
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The diagnostic query `cpp/diagnostics/successfully-extracted-files` now considers any C/C++ file seen during extraction, even one with some errors, to be extracted / scanned. This affects the Code Scanning UI measure of scanned C/C++ files.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
| containserror.cpp:0:0:0:0 | containserror.cpp | File successfully extracted. |
2+
| containswarning.cpp:0:0:0:0 | containswarning.cpp | File successfully extracted. |
3+
| doesnotcompile.cpp:0:0:0:0 | doesnotcompile.cpp | File successfully extracted. |
4+
| header.h:0:0:0:0 | header.h | File successfully extracted. |
5+
| successful.cpp:0:0:0:0 | successful.cpp | File successfully extracted. |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Diagnostics/ExtractedFiles.ql
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| doesnotcompile.cpp:4:2:4:2 | Recoverable extraction error: identifier 'This' is undefined | Extraction failed in doesnotcompile.cpp with error "doesnotcompile.cpp", line 4: error: identifier "This" is undefined\n \tThis is not correct C/C++ code.\n \t^\n\n | 2 |
2+
| doesnotcompile.cpp:4:10:4:10 | Recoverable extraction error: expected a ';' | Extraction failed in doesnotcompile.cpp with error "doesnotcompile.cpp", line 4: error: expected a ";"\n \tThis is not correct C/C++ code.\n \t ^\n\n | 2 |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Diagnostics/Internal/ExtractionErrors.ql
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| doesnotcompile.cpp:4:2:4:2 | Recoverable extraction error: identifier 'This' is undefined | Extraction failed in doesnotcompile.cpp with warning "doesnotcompile.cpp", line 4: error: identifier "This" is undefined\n \tThis is not correct C/C++ code.\n \t^\n\n | 1 |
2+
| doesnotcompile.cpp:4:10:4:10 | Recoverable extraction error: expected a ';' | Extraction failed in doesnotcompile.cpp with warning "doesnotcompile.cpp", line 4: error: expected a ";"\n \tThis is not correct C/C++ code.\n \t ^\n\n | 1 |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Diagnostics/ExtractionWarnings.ql

cpp/ql/test/query-tests/Diagnostics/FailedExtractorInvocations.expected

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Diagnostics/FailedExtractorInvocations.ql

0 commit comments

Comments
 (0)