Skip to content

Commit b1c9982

Browse files
committed
Rename WarningLevel
1 parent 7328806 commit b1c9982

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

Sources/PackageDescription/BuildSettings.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public struct CSetting: Sendable {
218218
/// - condition: A condition that restricts the application of the build setting.
219219
@available(_PackageDescription, introduced: 6.2)
220220
public static func treatAllWarnings(
221-
as level: WarningTreatLevel,
221+
as level: WarningLevel,
222222
_ condition: BuildSettingCondition? = nil
223223
) -> CSetting {
224224
return CSetting(
@@ -243,7 +243,7 @@ public struct CSetting: Sendable {
243243
@available(_PackageDescription, introduced: 6.2)
244244
public static func treatWarning(
245245
name: String,
246-
as level: WarningTreatLevel,
246+
as level: WarningLevel,
247247
_ condition: BuildSettingCondition? = nil
248248
) -> CSetting {
249249
return CSetting(
@@ -374,7 +374,7 @@ public struct CXXSetting: Sendable {
374374
/// - condition: A condition that restricts the application of the build setting.
375375
@available(_PackageDescription, introduced: 6.2)
376376
public static func treatAllWarnings(
377-
as level: WarningTreatLevel,
377+
as level: WarningLevel,
378378
_ condition: BuildSettingCondition? = nil
379379
) -> CXXSetting {
380380
return CXXSetting(
@@ -399,7 +399,7 @@ public struct CXXSetting: Sendable {
399399
@available(_PackageDescription, introduced: 6.2)
400400
public static func treatWarning(
401401
name: String,
402-
as level: WarningTreatLevel,
402+
as level: WarningLevel,
403403
_ condition: BuildSettingCondition? = nil
404404
) -> CXXSetting {
405405
return CXXSetting(
@@ -651,7 +651,7 @@ public struct SwiftSetting: Sendable {
651651
/// - condition: A condition that restricts the application of the build setting.
652652
@available(_PackageDescription, introduced: 6.2)
653653
public static func treatAllWarnings(
654-
as level: WarningTreatLevel,
654+
as level: WarningLevel,
655655
_ condition: BuildSettingCondition? = nil
656656
) -> SwiftSetting {
657657
return SwiftSetting(
@@ -676,7 +676,7 @@ public struct SwiftSetting: Sendable {
676676
@available(_PackageDescription, introduced: 6.2)
677677
public static func treatWarning(
678678
name: String,
679-
as level: WarningTreatLevel,
679+
as level: WarningLevel,
680680
_ condition: BuildSettingCondition? = nil
681681
) -> SwiftSetting {
682682
return SwiftSetting(

Sources/PackageDescription/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ add_library(PackageDescription
2424
Trait.swift
2525
Version.swift
2626
Version+StringLiteralConvertible.swift
27-
WarningTreatLevel.swift)
27+
WarningLevel.swift)
2828

2929
target_compile_options(PackageDescription PUBLIC
3030
$<$<COMPILE_LANGUAGE:Swift>:-package-description-version$<SEMICOLON>999.0>)

Sources/PackageDescription/WarningTreatLevel.swift renamed to Sources/PackageDescription/WarningLevel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/// `SwiftSetting.treatWarning(name:as:_:)` methods to control how warnings
1616
/// are handled during compilation.
1717
@available(_PackageDescription, introduced: 6.2)
18-
public enum WarningTreatLevel: String {
18+
public enum WarningLevel: String {
1919
/// Treat as a warning.
2020
///
2121
/// Warnings will be displayed during compilation but will not cause the build to fail.

Sources/PackageLoading/ManifestJSONParser.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ extension TargetBuildSettingDescription.Kind {
563563

564564
let rawLevel = values[0]
565565

566-
guard let level = TargetBuildSettingDescription.WarningTreatLevel(rawValue: rawLevel) else {
566+
guard let level = TargetBuildSettingDescription.WarningLevel(rawValue: rawLevel) else {
567567
throw InternalError("unknown warning treat level: \(rawLevel)")
568568
}
569569

@@ -577,7 +577,7 @@ extension TargetBuildSettingDescription.Kind {
577577
let name = values[0]
578578
let rawValue = values[1]
579579

580-
guard let level = TargetBuildSettingDescription.WarningTreatLevel(rawValue: rawValue) else {
580+
guard let level = TargetBuildSettingDescription.WarningLevel(rawValue: rawValue) else {
581581
throw InternalError("unknown warning treat level: \(rawValue)")
582582
}
583583

Sources/PackageModel/Manifest/TargetBuildSettingDescription.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public enum TargetBuildSettingDescription {
2626
}
2727

2828
/// The level at which a compiler warning should be treated.
29-
public enum WarningTreatLevel: String, Codable, Hashable, Sendable {
29+
public enum WarningLevel: String, Codable, Hashable, Sendable {
3030
case warning
3131
case error
3232
}
@@ -48,8 +48,8 @@ public enum TargetBuildSettingDescription {
4848

4949
case swiftLanguageMode(SwiftLanguageVersion)
5050

51-
case treatAllWarnings(WarningTreatLevel)
52-
case treatWarning(String, WarningTreatLevel)
51+
case treatAllWarnings(WarningLevel)
52+
case treatWarning(String, WarningLevel)
5353
case enableWarning(String)
5454
case disableWarning(String)
5555

Tests/BuildTests/BuildPlanTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -4611,7 +4611,7 @@ final class BuildPlanTests: XCTestCase {
46114611
}
46124612
}
46134613

4614-
func testWarningTreatLevelSettings() async throws {
4614+
func testWarningLevelSettings() async throws {
46154615
let Pkg: AbsolutePath = "/Pkg"
46164616

46174617
let fs: FileSystem = InMemoryFileSystem(

0 commit comments

Comments
 (0)