Skip to content

Commit 85dc61d

Browse files
authored
Treat bridging headers as test-related (#7588)
As discussed in #7547 (comment), this patch makes sure that bridging headers may use angle-bracket imports.
1 parent 38a056f commit 85dc61d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/check_imports.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ private func checkFile(_ file: String, logger: ErrorLogger, inRepo repoURL: URL)
8787
// Treat all files with names finishing on "Test" or "Tests" as files with tests.
8888
let isTestFile = file.contains("Test.m") || file.contains("Tests.m") ||
8989
file.contains("Test.swift") || file.contains("Tests.swift")
90+
let isBridgingHeader = file.contains("Bridging-Header.h")
9091
var inSwiftPackage = false
9192
var inSwiftPackageElse = false
9293
let lines = fileContents.components(separatedBy: .newlines)
@@ -141,7 +142,7 @@ private func checkFile(_ file: String, logger: ErrorLogger, inRepo repoURL: URL)
141142
logger.importLog("Import \(importFileRaw) does not exist.", file, lineNum)
142143
}
143144
}
144-
} else if importFile.first == "<", !isPrivate, !isTestFile {
145+
} else if importFile.first == "<", !isPrivate, !isTestFile, !isBridgingHeader {
145146
// Verify that double quotes are always used for intra-module imports.
146147
if importFileRaw.starts(with: "Firebase") {
147148
logger

0 commit comments

Comments
 (0)