@@ -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
@@ -71,9 +61,6 @@ public struct Configuration: Codable, Equatable {
71
61
72
62
/// MARK: Common configuration
73
63
74
- /// Is all formatting disbled?
75
- public var skipAll = false
76
-
77
64
/// The dictionary containing the rule names that we wish to run on. A rule is not used if it is
78
65
/// marked as `false`, or if it is missing from the dictionary.
79
66
public var rules : [ String : Bool ]
@@ -284,13 +271,6 @@ public struct Configuration: Codable, Equatable {
284
271
285
272
/// Creates a new `Configuration` by loading it from a configuration file.
286
273
public init ( contentsOf url: URL ) throws {
287
- if url. lastPathComponent == Self . suppressionFileName {
288
- var config = Configuration ( )
289
- config. skipAll = true
290
- self = config
291
- return
292
- }
293
-
294
274
let data = try Data ( contentsOf: url)
295
275
try self . init ( data: data)
296
276
}
@@ -324,9 +304,6 @@ public struct Configuration: Codable, Equatable {
324
304
// default-initialized instance.
325
305
let defaults = Configuration ( )
326
306
327
- self . skipAll =
328
- try container. decodeIfPresent ( Bool . self, forKey: . skipAll)
329
- ?? false
330
307
self . maximumBlankLines =
331
308
try container. decodeIfPresent ( Int . self, forKey: . maximumBlankLines)
332
309
?? defaults. maximumBlankLines
@@ -420,7 +397,6 @@ public struct Configuration: Codable, Equatable {
420
397
var container = encoder. container ( keyedBy: CodingKeys . self)
421
398
422
399
try container. encode ( version, forKey: . version)
423
- try container. encode ( skipAll, forKey: . skipAll)
424
400
try container. encode ( maximumBlankLines, forKey: . maximumBlankLines)
425
401
try container. encode ( lineLength, forKey: . lineLength)
426
402
try container. encode ( spacesBeforeEndOfLineComments, forKey: . spacesBeforeEndOfLineComments)
@@ -465,11 +441,7 @@ public struct Configuration: Codable, Equatable {
465
441
}
466
442
repeat {
467
443
candidateDirectory. deleteLastPathComponent ( )
468
- let suppressingFile = candidateDirectory. appendingPathComponent ( Self . suppressionFileName)
469
- if FileManager . default. isReadableFile ( atPath: suppressingFile. path) {
470
- return suppressingFile
471
- }
472
- let candidateFile = candidateDirectory. appendingPathComponent ( Self . configurationFileName)
444
+ let candidateFile = candidateDirectory. appendingPathComponent ( " .swift-format " )
473
445
if FileManager . default. isReadableFile ( atPath: candidateFile. path) {
474
446
return candidateFile
475
447
}
0 commit comments