mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Swift: add a query showing successfully extracted files
(cherry picked from commit 7c15527300)
This commit is contained in:
committed by
Paolo Tranquilli
parent
218ed8ad37
commit
635564531c
15
swift/ql/src/diagnostics/SuccessfullyExtractedFiles.ql
Normal file
15
swift/ql/src/diagnostics/SuccessfullyExtractedFiles.ql
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @name Successfully extracted files
|
||||
* @description Lists all files in the source code directory that were extracted without encountering a problem in the file.
|
||||
* @kind diagnostic
|
||||
* @id swift/diagnostics/successfully-extracted-files
|
||||
* @tags successfully-extracted-files
|
||||
*/
|
||||
|
||||
import swift
|
||||
|
||||
from File f
|
||||
where
|
||||
not exists(CompilerError e | e.getFile() = f) and
|
||||
f.getBaseName().regexpMatch(".*\\.swift\\z")
|
||||
select f, "File successfully extracted."
|
||||
@@ -0,0 +1 @@
|
||||
| main.swift:0:0:0:0 | main.swift | File successfully extracted. |
|
||||
@@ -0,0 +1 @@
|
||||
diagnostics/SuccessfullyExtractedFiles.ql
|
||||
2
swift/ql/test/query-tests/Diagnostics/error.swift
Normal file
2
swift/ql/test/query-tests/Diagnostics/error.swift
Normal file
@@ -0,0 +1,2 @@
|
||||
//codeql-extractor-expected-status: 1
|
||||
#error("Uh oh")
|
||||
0
swift/ql/test/query-tests/Diagnostics/main.swift
Normal file
0
swift/ql/test/query-tests/Diagnostics/main.swift
Normal file
Reference in New Issue
Block a user