File tree 2 files changed +9
-9
lines changed
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.
201
201
### Configuring the Command Line Tool
202
202
203
203
For 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.
206
207
207
208
If 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.
211
211
212
212
If neither configuration file is found, the search for files continues
213
213
in 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 {
451
451
}
452
452
repeat {
453
453
candidateDirectory. deleteLastPathComponent ( )
454
- let candidateFile = candidateDirectory. appendingPathComponent ( Self . configurationFileName)
455
- if FileManager . default. isReadableFile ( atPath: candidateFile. path) {
456
- return candidateFile
457
- }
458
454
let suppressingFile = candidateDirectory. appendingPathComponent ( Self . suppressionFileName)
459
455
if FileManager . default. isReadableFile ( atPath: suppressingFile. path) {
460
456
return suppressingFile
461
457
}
458
+ let candidateFile = candidateDirectory. appendingPathComponent ( Self . configurationFileName)
459
+ if FileManager . default. isReadableFile ( atPath: candidateFile. path) {
460
+ return candidateFile
461
+ }
462
462
} while !candidateDirectory. isRoot
463
463
464
464
return nil
You can’t perform that action at this time.
0 commit comments