@@ -24,19 +24,9 @@ internal let highestSupportedConfigurationVersion = 1
24
24
/// Holds the complete set of configured values and defaults.
25
25
public struct Configuration : Codable , Equatable {
26
26
27
- /// Name of the configuration file to look for.
28
- /// The presence of this file in a directory will cause the formatter
29
- /// to use the configuration specified in that file.
30
- private static let configurationFileName = " .swift-format "
31
-
32
- /// Name of the suppression file to look for.
33
- /// The presence of this file in a directory will cause the formatter
34
- /// to skip formatting files in that directory and its subdirectories.
35
- private static let suppressionFileName = " .swift-format-ignore "
36
27
37
28
private enum CodingKeys : CodingKey {
38
29
case version
39
- case skipAll
40
30
case maximumBlankLines
41
31
case lineLength
42
32
case spacesBeforeEndOfLineComments
@@ -70,9 +60,6 @@ public struct Configuration: Codable, Equatable {
70
60
71
61
/// MARK: Common configuration
72
62
73
- /// Is all formatting disbled?
74
- public var skipAll = false
75
-
76
63
/// The dictionary containing the rule names that we wish to run on. A rule is not used if it is
77
64
/// marked as `false`, or if it is missing from the dictionary.
78
65
public var rules : [ String : Bool ]
@@ -276,13 +263,6 @@ public struct Configuration: Codable, Equatable {
276
263
277
264
/// Creates a new `Configuration` by loading it from a configuration file.
278
265
public init ( contentsOf url: URL ) throws {
279
- if url. lastPathComponent == Self . suppressionFileName {
280
- var config = Configuration ( )
281
- config. skipAll = true
282
- self = config
283
- return
284
- }
285
-
286
266
let data = try Data ( contentsOf: url)
287
267
try self . init ( data: data)
288
268
}
@@ -316,9 +296,6 @@ public struct Configuration: Codable, Equatable {
316
296
// default-initialized instance.
317
297
let defaults = Configuration ( )
318
298
319
- self . skipAll =
320
- try container. decodeIfPresent ( Bool . self, forKey: . skipAll)
321
- ?? false
322
299
self . maximumBlankLines =
323
300
try container. decodeIfPresent ( Int . self, forKey: . maximumBlankLines)
324
301
?? defaults. maximumBlankLines
@@ -406,7 +383,6 @@ public struct Configuration: Codable, Equatable {
406
383
var container = encoder. container ( keyedBy: CodingKeys . self)
407
384
408
385
try container. encode ( version, forKey: . version)
409
- try container. encode ( skipAll, forKey: . skipAll)
410
386
try container. encode ( maximumBlankLines, forKey: . maximumBlankLines)
411
387
try container. encode ( lineLength, forKey: . lineLength)
412
388
try container. encode ( spacesBeforeEndOfLineComments, forKey: . spacesBeforeEndOfLineComments)
@@ -451,11 +427,7 @@ public struct Configuration: Codable, Equatable {
451
427
}
452
428
repeat {
453
429
candidateDirectory. deleteLastPathComponent ( )
454
- let suppressingFile = candidateDirectory. appendingPathComponent ( Self . suppressionFileName)
455
- if FileManager . default. isReadableFile ( atPath: suppressingFile. path) {
456
- return suppressingFile
457
- }
458
- let candidateFile = candidateDirectory. appendingPathComponent ( Self . configurationFileName)
430
+ let candidateFile = candidateDirectory. appendingPathComponent ( " .swift-format " )
459
431
if FileManager . default. isReadableFile ( atPath: candidateFile. path) {
460
432
return candidateFile
461
433
}
0 commit comments