diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fd587e35c..70fb5f5645 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ [JP Simard](https://github.com/jpsim) [#277](https://github.com/realm/SwiftLint/issues/277) -* Add nested `.swiftlint.yml` configuration support. +* Add nested `.swiftlint.yml` configuration support. [Scott Hoyt](https://github.com/scottrhoyt) [#299](https://github.com/realm/SwiftLint/issues/299) diff --git a/README.md b/README.md index 392e64cc18..475fafbe85 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ directory to see the currently implemented rules. ### Disable a rule in code -Rules can be disabled with a comment inside a source file with the following format: +Rules can be disabled with a comment inside a source file with the following format: `// swiftlint:disable ` @@ -136,6 +136,20 @@ variable_name_min_length: reporter: "csv" # reporter type (xcode, json, csv, checkstyle) ``` +#### Nested Configurations + +SwiftLint supports nesting configuration files for more granular control over +the linting process. + + * Set the `use_nested_configs: true` value in your root `.swiftlint.yml` file + * Include additional `.swiftlint.yml` files where necessary in your directory + structure. + * Each file will be linted using the configuration file that is in it's + directory or at the deepest level of it's parent directories. Otherwise the + root configuration will be used. + * `excluded`, `included`, and `use_nested_configs` are ignored for nested + configurations + ### Auto-correct SwiftLint can automatically correct certain violations. Files on disk are