Apparently nested configurations was such a mess in SwiftLint that they completely broke the way it worked before and introduced the new parent/child configuration support.
https://github.com/realm/SwiftLint#child--parent-configs-locally
The extension doesn't support it though.
In my example I had the parent config sitting in the root of my project and a child config sitting few levels down referring back to child config.
For example
root
├── .swiftlint.yml
└── dir
└── dir
└── .swiftlint.yml
The parent config doesn't disable force_try
which is on by default.
The dir/dir/.swiflint.yml
child config referes to parent config and disables force_try
rule for all files sitting in dir/dir
.
parent_config: ../../.swiftlint.yml
disabled_rules:
- force_try
This works good with command line invocations, e.g.
It will respect child configs.
The extension doesn't though.
Initially when the project is loaded it seems to report force_try
for all files including those in dir/dir
which should not be reported.
But then, when I actually open the file from dir/dir
in the editor, it doesn't just report force_try
but also seems to completely disregard the parent .swiftlint.yml
from the root and use default SwiftLint ruleset like 120 char line limit and so on.
I tried adding all the .swiftlint.yml
files to Config Search Paths but it didn't make any difference and I wouldn't really want to add every single .swiftlint.yml
in the project to the settings, it's difficult to maintain.