@@ -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
@@ -70,9 +60,6 @@ public struct Configuration: Codable, Equatable {
7060
7161 /// MARK: Common configuration
7262
73- /// Is all formatting disbled?
74- public var skipAll = false
75-
7663 /// The dictionary containing the rule names that we wish to run on. A rule is not used if it is
7764 /// marked as `false`, or if it is missing from the dictionary.
7865 public var rules : [ String : Bool ]
@@ -276,13 +263,6 @@ public struct Configuration: Codable, Equatable {
276263
277264 /// Creates a new `Configuration` by loading it from a configuration file.
278265 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-
286266 let data = try Data ( contentsOf: url)
287267 try self . init ( data: data)
288268 }
@@ -316,9 +296,6 @@ public struct Configuration: Codable, Equatable {
316296 // default-initialized instance.
317297 let defaults = Configuration ( )
318298
319- self . skipAll =
320- try container. decodeIfPresent ( Bool . self, forKey: . skipAll)
321- ?? false
322299 self . maximumBlankLines =
323300 try container. decodeIfPresent ( Int . self, forKey: . maximumBlankLines)
324301 ?? defaults. maximumBlankLines
@@ -406,7 +383,6 @@ public struct Configuration: Codable, Equatable {
406383 var container = encoder. container ( keyedBy: CodingKeys . self)
407384
408385 try container. encode ( version, forKey: . version)
409- try container. encode ( skipAll, forKey: . skipAll)
410386 try container. encode ( maximumBlankLines, forKey: . maximumBlankLines)
411387 try container. encode ( lineLength, forKey: . lineLength)
412388 try container. encode ( spacesBeforeEndOfLineComments, forKey: . spacesBeforeEndOfLineComments)
@@ -451,11 +427,7 @@ public struct Configuration: Codable, Equatable {
451427 }
452428 repeat {
453429 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 " )
459431 if FileManager . default. isReadableFile ( atPath: candidateFile. path) {
460432 return candidateFile
461433 }
0 commit comments