@@ -200,17 +200,14 @@ configuration, by redirecting it to a file and editing it.
200
200
201
201
### Configuring the Command Line Tool
202
202
203
- For any source file being checked or formatted, ` swift-format ` looks for a
204
- JSON-formatted file named ` .swift-format-ignore ` in the same directory.
205
- The presence of this file will disable all formatting and linting.
206
- The contents of ` .swift-format-ignore ` are ignored - it can be an empty file.
203
+ For any source file being checked or formatted, ` swift-format ` looks for
204
+ configuration files in the same directory, and parent directories.
207
205
208
- If the file is not found, then it looks in the same directory for a file
209
- called ` .swift-format ` . If one is found, then that file is loaded to
210
- determine the tool's configuration.
206
+ If it finds a file named ` .swift-format-ignore ` , it will disable all
207
+ formatting and linting.
211
208
212
- If neither configuration file is found, the search for files continues
213
- in the parent directory, and so on.
209
+ If it finds a JSON-formatted file called ` .swift-format ` , then that
210
+ file is loaded to determine the tool's configuration.
214
211
215
212
If no configuration file is found at any level, a default configuration
216
213
is used. The settings in the default configuration can be viewed by
@@ -225,6 +222,9 @@ See [Documentation/Configuration.md](Documentation/Configuration.md) for a
225
222
description of the configuration file format and the settings that are
226
223
available.
227
224
225
+ Note that the contents of any ` .swift-format-ignore ` are ignored; the
226
+ file can be empty.
227
+
228
228
### Miscellaneous
229
229
230
230
Running ` swift-format -v ` or ` swift-format --version ` will print version
0 commit comments