Skip to content

Commit 4355b3a

Browse files
authored
Enable more CI warnings (#347)
Enable more CI warnings ### Motivation Fixes #332 and re-enables warnings as errors as we don't have deprecation warnings in our tests anymore. ### Modifications Enabled a few previously disabled warnings/errors. ### Result Stricter CI. ### Test Plan The CI on this PR. Reviewed by: PeterAdams-A Builds: ✔︎ pull request validation (5.10) - Build finished. ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (compatibility test) - Build finished. ✔︎ pull request validation (docc test) - Build finished. ✔︎ pull request validation (integration test) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. #347
1 parent 69eb1a2 commit 4355b3a

File tree

6 files changed

+24
-41
lines changed

6 files changed

+24
-41
lines changed

Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
//===----------------------------------------------------------------------===//
1414
import Foundation
1515

16+
#if compiler(>=5.11)
17+
extension FileHandle: @retroactive TextOutputStream {}
18+
#else
19+
extension FileHandle: TextOutputStream {}
20+
#endif
21+
1622
extension InMemoryInputFile {
1723
/// Creates a new in-memory file by reading the contents at the specified path.
1824
/// - Parameter url: The path to the file to read.
@@ -23,7 +29,7 @@ extension InMemoryInputFile {
2329
/// File handle to stderr.
2430
let stdErrHandle = FileHandle.standardError
2531

26-
extension FileHandle: TextOutputStream {
32+
extension FileHandle {
2733
/// Writes the given string to the file handle.
2834
///
2935
/// This method writes the provided string to the file handle using its UTF-8

Sources/swift-openapi-generator/Extensions.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@ import ArgumentParser
1616
import _OpenAPIGeneratorCore
1717
import Yams
1818

19-
extension URL: ExpressibleByArgument {
19+
#if compiler(>=5.11)
20+
extension URL: @retroactive ExpressibleByArgument {}
21+
extension GeneratorMode: @retroactive ExpressibleByArgument {}
22+
extension FeatureFlag: @retroactive ExpressibleByArgument {}
23+
#else
24+
extension URL: ExpressibleByArgument {}
25+
extension GeneratorMode: ExpressibleByArgument {}
26+
extension FeatureFlag: ExpressibleByArgument {}
27+
#endif
28+
29+
extension URL {
2030

2131
/// Creates a `URL` instance from a string argument.
2232
///
@@ -25,9 +35,6 @@ extension URL: ExpressibleByArgument {
2535
public init?(argument: String) { self.init(fileURLWithPath: argument) }
2636
}
2737

28-
extension GeneratorMode: ExpressibleByArgument {}
29-
extension FeatureFlag: ExpressibleByArgument {}
30-
3138
extension CaseIterable where Self: RawRepresentable, Self.RawValue == String {
3239

3340
/// A string representation of the raw values of all the cases,

docker/docker-compose.2204.510.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ services:
1111
image: *image
1212
environment:
1313
- WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
14-
# SwiftSyntax currently imports a module it does not explicitly depend
15-
# on and so we must disable this for the time being.
16-
# - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
14+
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
1715
- STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
18-
1916
shell:
2017
image: *image

docker/docker-compose.2204.58.yaml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,8 @@ services:
1111
test:
1212
image: *image
1313
environment:
14-
# Because OpenAPI supports deprecation, the generated code could include
15-
# deprecated symbols, which will produce warnings.
16-
#
17-
# We'll disable -warnings-as-errors for now and revisit this when we
18-
# refactor the compilation of the generated code into a separate
19-
# pipeline.
20-
#
21-
# - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
22-
23-
# SwiftSyntax currently imports a module it does not explicitly depend
24-
# on and so we must disable this for the time being.
25-
# - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
26-
14+
- WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
15+
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
2716
- STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
28-
2917
shell:
3018
image: *image

docker/docker-compose.2204.59.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ services:
1212
image: *image
1313
environment:
1414
- WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
15-
# SwiftSyntax currently imports a module it does not explicitly depend
16-
# on and so we must disable this for the time being.
17-
# - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
15+
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
1816
- STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
19-
2017
shell:
2118
image: *image

docker/docker-compose.2204.main.yaml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,8 @@ services:
1111
test:
1212
image: *image
1313
environment:
14-
# Because OpenAPI supports deprecation, the generated code could include
15-
# deprecated symbols, which will produce warnings.
16-
#
17-
# We'll disable -warnings-as-errors for now and revisit this when we
18-
# refactor the compilation of the generated code into a separate
19-
# pipeline.
20-
#
21-
# - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
22-
23-
# SwiftSyntax currently imports a module it does not explicitly depend
24-
# on and so we must disable this for the time being.
25-
# - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
26-
14+
- WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
15+
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
2716
- STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
28-
2917
shell:
3018
image: *image

0 commit comments

Comments
 (0)