From 9f8b5bccc20e7d582b2f2858437b452e13e50784 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 2 Jan 2024 21:39:00 +0000 Subject: [PATCH 1/2] Go: report any extracted file as successfully extracted --- .../change-notes/2024-01-02-go-successfully-extracted.md | 4 ++++ go/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 go/ql/lib/change-notes/2024-01-02-go-successfully-extracted.md diff --git a/go/ql/lib/change-notes/2024-01-02-go-successfully-extracted.md b/go/ql/lib/change-notes/2024-01-02-go-successfully-extracted.md new file mode 100644 index 000000000000..7cc21215c817 --- /dev/null +++ b/go/ql/lib/change-notes/2024-01-02-go-successfully-extracted.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The diagnostic query `go/diagnostics/successfully-extracted-files`, and therefore the Code Scanning UI measure of scanned Go files, now considers any Go file seen during extraction, even one with some errors, to be extracted / scanned. diff --git a/go/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql b/go/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql index 5a5f5d995a2a..7e740d35a62e 100644 --- a/go/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +++ b/go/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql @@ -1,7 +1,7 @@ /** * @id go/diagnostics/successfully-extracted-files - * @name Successfully analyzed files - * @description List all files that were successfully extracted. + * @name Extracted files + * @description List all files that were extracted. * @kind diagnostic * @tags successfully-extracted-files */ @@ -9,7 +9,5 @@ import go from File f -where - not exists(Error e | e.getFile() = f) and - exists(f.getRelativePath()) +where exists(f.getRelativePath()) select f, "" From 13b00bae170dd933e4467908c85aca9a67e6dbb9 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 2 Jan 2024 22:38:30 +0000 Subject: [PATCH 2/2] Update test expectation --- .../query-tests/Diagnostics/SuccessfullyExtractedFiles.expected | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected b/go/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected index 6b66e5a1ae75..f038c938c6dc 100644 --- a/go/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected +++ b/go/ql/test/query-tests/Diagnostics/SuccessfullyExtractedFiles.expected @@ -1,2 +1,4 @@ | ../../go.mod:0:0:0:0 | ../../go.mod | | +| badimport.go:0:0:0:0 | badimport.go | | +| type.go:0:0:0:0 | type.go | | | util.go:0:0:0:0 | util.go | |