@@ -24,19 +24,9 @@ internal let highestSupportedConfigurationVersion = 1
2424/// Holds the complete set of configured values and defaults.
2525public struct Configuration : Codable , Equatable {
2626
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 "
3627
3728 private enum CodingKeys : CodingKey {
3829 case version
39- case skipAll
4030 case maximumBlankLines
4131 case lineLength
4232 case spacesBeforeEndOfLineComments
@@ -71,9 +61,6 @@ public struct Configuration: Codable, Equatable {
7161
7262 /// MARK: Common configuration
7363
74- /// Is all formatting disbled?
75- public var skipAll = false
76-
7764 /// The dictionary containing the rule names that we wish to run on. A rule is not used if it is
7865 /// marked as `false`, or if it is missing from the dictionary.
7966 public var rules : [ String : Bool ]
@@ -284,13 +271,6 @@ public struct Configuration: Codable, Equatable {
284271
285272 /// Creates a new `Configuration` by loading it from a configuration file.
286273 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-
294274 let data = try Data ( contentsOf: url)
295275 try self . init ( data: data)
296276 }
@@ -324,9 +304,6 @@ public struct Configuration: Codable, Equatable {
324304 // default-initialized instance.
325305 let defaults = Configuration ( )
326306
327- self . skipAll =
328- try container. decodeIfPresent ( Bool . self, forKey: . skipAll)
329- ?? false
330307 self . maximumBlankLines =
331308 try container. decodeIfPresent ( Int . self, forKey: . maximumBlankLines)
332309 ?? defaults. maximumBlankLines
@@ -420,7 +397,6 @@ public struct Configuration: Codable, Equatable {
420397 var container = encoder. container ( keyedBy: CodingKeys . self)
421398
422399 try container. encode ( version, forKey: . version)
423- try container. encode ( skipAll, forKey: . skipAll)
424400 try container. encode ( maximumBlankLines, forKey: . maximumBlankLines)
425401 try container. encode ( lineLength, forKey: . lineLength)
426402 try container. encode ( spacesBeforeEndOfLineComments, forKey: . spacesBeforeEndOfLineComments)
@@ -465,11 +441,7 @@ public struct Configuration: Codable, Equatable {
465441 }
466442 repeat {
467443 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 " )
473445 if FileManager . default. isReadableFile ( atPath: candidateFile. path) {
474446 return candidateFile
475447 }
0 commit comments