Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Excluded paths in nested configurations are ignored #2447
New Issue Checklist
Describe the bug
My example project has this structure:
excluded: - B
When I run
An explanation as to why I'm trying to do this: We have a common base
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint Loading configuration from '.swiftlint.yml' Linting Swift files at paths Linting 'Longcat.swift' (1/2) Linting 'Hello.swift' (2/2) .../swiftlint-example/A/B/Longcat.swift:1: warning: Line Length Violation: Line should be 120 characters or less: currently 189 characters (line_length) Done linting! Found 1 violation, 0 serious in 2 files.
In this instance, I was using the
Yes. Toplevel is empty, nested config is the one shown above.
I've attached my minimal example project: swiftlint-nested-exclude-example.zip
I think I found a solution. When SwiftLint is linting files in visitLintableFiles in Configuration+CommandLine, it:
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.
Take a look at my PR :)