Skip to content

Commit 03ce2b0

Browse files
authored
Merge pull request #19346 from jketema/swift-files-2
Swift: Make file checking in integration tests more strict
2 parents 375ec8f + a211998 commit 03ce2b0

File tree

15 files changed

+31
-8
lines changed

15 files changed

+31
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import swift
22

33
from File f
4+
where exists(f.getRelativePath()) or f instanceof UnknownFile
45
select f
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import swift
22

33
from File f
4+
where exists(f.getRelativePath()) or f instanceof UnknownFile
45
select f
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import swift
22

33
from File f
4+
where exists(f.getRelativePath()) or f instanceof UnknownFile
45
select f
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import swift
22

33
from File f
4+
where exists(f.getRelativePath()) or f instanceof UnknownFile
45
select f
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import swift
22

33
from ClassDecl d
4-
where d.getLocation().getFile().getBaseName() != "Package.swift"
4+
where
5+
d.getLocation().getFile().getBaseName() != "Package.swift" and
6+
exists(d.getLocation().getFile().getRelativePath())
57
select d
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import swift
22

33
from Deinitializer d
4-
where d.getLocation().getFile().getBaseName() != "Package.swift"
4+
where
5+
d.getLocation().getFile().getBaseName() != "Package.swift" and
6+
exists(d.getLocation().getFile().getRelativePath())
57
select d
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import swift
22

33
from EnumDecl d
4-
where d.getLocation().getFile().getBaseName() != "Package.swift"
4+
where
5+
d.getLocation().getFile().getBaseName() != "Package.swift" and
6+
exists(d.getLocation().getFile().getRelativePath())
57
select d
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import codeql.swift.elements.decl.internal.AccessorOrNamedFunction
22

33
from AccessorOrNamedFunction f
4-
where f.getLocation().getFile().getBaseName() != "Package.swift"
4+
where
5+
f.getLocation().getFile().getBaseName() != "Package.swift" and
6+
exists(f.getLocation().getFile().getRelativePath())
57
select f
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import swift
22

33
from Initializer d
4-
where d.getLocation().getFile().getBaseName() != "Package.swift"
4+
where
5+
d.getLocation().getFile().getBaseName() != "Package.swift" and
6+
exists(d.getLocation().getFile().getRelativePath())
57
select d
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import swift
22

33
from ProtocolDecl d
4-
where d.getLocation().getFile().getBaseName() != "Package.swift"
4+
where
5+
d.getLocation().getFile().getBaseName() != "Package.swift" and
6+
exists(d.getLocation().getFile().getRelativePath())
57
select d
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import swift
22

33
from StructDecl d
4-
where d.getLocation().getFile().getBaseName() != "Package.swift"
4+
where
5+
d.getLocation().getFile().getBaseName() != "Package.swift" and
6+
exists(d.getLocation().getFile().getRelativePath())
57
select d
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import swift
22

33
from VarDecl d
4-
where d.getLocation().getFile().getBaseName() != "Package.swift"
4+
where
5+
d.getLocation().getFile().getBaseName() != "Package.swift" and
6+
exists(d.getLocation().getFile().getRelativePath())
57
select d
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import swift
22

33
from File f
4+
where exists(f.getRelativePath()) or f instanceof UnknownFile
45
select f
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import swift
22

33
from File f
4+
where exists(f.getRelativePath()) or f instanceof UnknownFile
45
select f
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import swift
22

33
from File f
4+
where exists(f.getRelativePath()) or f instanceof UnknownFile
45
select f

0 commit comments

Comments
 (0)