Skip to content

Commit a7d4c24

Browse files
committed
Change flag to skipAll.
1 parent aac6fe8 commit a7d4c24

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Documentation/Configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ top-level keys and values:
1111
* `version` _(number)_: The version of the configuration file. For now, this
1212
should always be `1`.
1313

14-
* `allDisabled` _(boolean)_: If this is true, all other configuration
14+
* `skipAll` _(boolean)_: If this is true, all other configuration
1515
options are ignored, and formatting is disabled.
1616

1717
* `lineLength` _(number)_: The maximum allowed length of a line, in

Sources/SwiftFormat/API/Configuration.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public struct Configuration: Codable, Equatable {
3636

3737
private enum CodingKeys: CodingKey {
3838
case version
39-
case allDisabled
39+
case skipAll
4040
case maximumBlankLines
4141
case lineLength
4242
case spacesBeforeEndOfLineComments
@@ -72,7 +72,7 @@ public struct Configuration: Codable, Equatable {
7272
/// MARK: Common configuration
7373

7474
/// Is all formatting disbled?
75-
public var allDisabled = false
75+
public var skipAll = false
7676

7777
/// The dictionary containing the rule names that we wish to run on. A rule is not used if it is
7878
/// marked as `false`, or if it is missing from the dictionary.
@@ -286,7 +286,7 @@ public struct Configuration: Codable, Equatable {
286286
public init(contentsOf url: URL) throws {
287287
if url.lastPathComponent == Self.suppressionFileName {
288288
var config = Configuration()
289-
config.allDisabled = true
289+
config.skipAll = true
290290
self = config
291291
return
292292
}
@@ -324,8 +324,8 @@ public struct Configuration: Codable, Equatable {
324324
// default-initialized instance.
325325
let defaults = Configuration()
326326

327-
self.allDisabled =
328-
try container.decodeIfPresent(Bool.self, forKey: .allDisabled)
327+
self.skipAll =
328+
try container.decodeIfPresent(Bool.self, forKey: .skipAll)
329329
?? false
330330
self.maximumBlankLines =
331331
try container.decodeIfPresent(Int.self, forKey: .maximumBlankLines)
@@ -420,7 +420,7 @@ public struct Configuration: Codable, Equatable {
420420
var container = encoder.container(keyedBy: CodingKeys.self)
421421

422422
try container.encode(version, forKey: .version)
423-
try container.encode(allDisabled, forKey: .allDisabled)
423+
try container.encode(skipAll, forKey: .skipAll)
424424
try container.encode(maximumBlankLines, forKey: .maximumBlankLines)
425425
try container.encode(lineLength, forKey: .lineLength)
426426
try container.encode(spacesBeforeEndOfLineComments, forKey: .spacesBeforeEndOfLineComments)

Sources/SwiftFormat/API/SwiftFormatter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ public final class SwiftFormatter {
111111
// also does not touch an empty file even if the setting to add trailing newlines is enabled.)
112112
guard !source.isEmpty else { return }
113113

114-
// If allDisabled is set, just emit the source as-is.
115-
guard !configuration.allDisabled else {
114+
// If skipAll is set, just emit the source as-is.
115+
guard !configuration.skipAll else {
116116
outputStream.write(source)
117117
return
118118
}

Sources/SwiftFormat/API/SwiftLinter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ public final class SwiftLinter {
9999
// also does not touch an empty file even if the setting to add trailing newlines is enabled.)
100100
guard !source.isEmpty else { return }
101101

102-
// If allDisabled is set, do nothing.
103-
guard !configuration.allDisabled else {
102+
// If skipAll is set, do nothing.
103+
guard !configuration.skipAll else {
104104
return
105105
}
106106

0 commit comments

Comments
 (0)