File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -201,13 +201,13 @@ configuration, by redirecting it to a file and editing it.
201201### Configuring the Command Line Tool
202202
203203For any source file being checked or formatted, ` swift-format ` looks for a
204- JSON-formatted file named ` .swift-format ` in the same directory. If one is
205- found, then that file is loaded to determine the tool's configuration.
204+ JSON-formatted file named ` .no-swift-format ` in the same directory.
205+ The presence of this file will disable all formatting and linting.
206+ The contents of ` .no-swift-format ` are ignored - it can be an empty file.
206207
207208If the file is not found, then it looks in the same directory for a file
208- called ` .no-swift-format ` . The presence of this file will
209- disable all formatting and linting. The contents of ` .no-swift-format `
210- are ignored - it can be an empty file.
209+ called ` .swift-format ` . If one is found, then that file is loaded to
210+ determine the tool's configuration.
211211
212212If neither configuration file is found, the search for files continues
213213in the parent directory, and so on.
Original file line number Diff line number Diff line change @@ -451,14 +451,14 @@ public struct Configuration: Codable, Equatable {
451451 }
452452 repeat {
453453 candidateDirectory. deleteLastPathComponent ( )
454- let candidateFile = candidateDirectory. appendingPathComponent ( Self . configurationFileName)
455- if FileManager . default. isReadableFile ( atPath: candidateFile. path) {
456- return candidateFile
457- }
458454 let suppressingFile = candidateDirectory. appendingPathComponent ( Self . suppressionFileName)
459455 if FileManager . default. isReadableFile ( atPath: suppressingFile. path) {
460456 return suppressingFile
461457 }
458+ let candidateFile = candidateDirectory. appendingPathComponent ( Self . configurationFileName)
459+ if FileManager . default. isReadableFile ( atPath: candidateFile. path) {
460+ return candidateFile
461+ }
462462 } while !candidateDirectory. isRoot
463463
464464 return nil
You can’t perform that action at this time.
0 commit comments