Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where nested configuration excluded files are ignored (#2648)
Fixes #2447 When SwiftLint is linting files in `visitLintableFiles` in `Configuration+CommandLine`, it: 1. Gathers all lintable files in `getFiles`. This is where the exclusion of files occurs based on the parent configuration's exclusion list. 2. These files are grouped by their specific configuration in `groupFiles`. This is where configurations for each available file are determined (and if nested configurations exist, merged). After these configurations are determined and the files are grouped accordingly, no more files are excluded from the lintable files list. Even though a file's configuration thinks it should be excluded, these files are not removed from the list of lintable files, generating the bug. 3. Finally, each file is visited by the linter. My solution is to skip files whose merged configurations specify they should be excluded in step 2 or `groupFiles`. Therefore, they will not be visited in step 3.
- Loading branch information