"excluded" parameter handling changed in 0.43.0
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- Updated SwiftLint to the latest version
- I searched for existing GitHub issues
Describe the bug
We have this exclusion in .swiftlint.yml and it was working in 0.42.0 but after upgrading to 0.43.0, code inside that directory is producing warnings.
excluded:
- Utils/3rdParty
Changing this to either path/from/git/root/Utils/3rdParty solves the issue.
Complete output when running SwiftLint, including the stack trace and command used
we have this script in our Xcode build phases:
ROOT_DIR="$(git rev-parse --show-toplevel)"
# using default lint rules if not overridden for the project
ln -s "$ROOT_DIR/.swiftlint.yml" "$SRCROOT/.swiftlint.yml"
"$($BREW --prefix)/bin/swiftlint" --path "$SRCROOT"
Environment
- SwiftLint version (run
swiftlint versionto be sure)?- 0.43.0
- Installation method used (Homebrew, CocoaPods, building from source, etc)?
- Homebrew
- Paste your configuration file:
excluded:
- Utils/3rdParty
- Are you using nested configurations?
If so, paste their relative paths and respective contents.- No
- Which Xcode version are you using (check
xcodebuild -version)?- 12.4
- Do you have a sample that shows the issue? Run
echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
to quickly test if your example is really demonstrating the issue. If your example is more
complex, you can useswiftlint lint --path [file here] --no-cache --enable-all-rules.- No
Edit: This is on an M1 MacBook, don't know if that matters.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the regression with the .swiftlint.yml exclusion and the Xcode build-phase command using --path "$SRCROOT". Trace how relative excluded paths are interpreted between versions, then add a regression test for Utils/3rdParty; done means the relative exclusion works again in 0.43.0 without requiring the repository-root prefix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100