realm / realm/SwiftLint

"excluded" parameter handling changed in 0.43.0

Open
#3,557 7 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist
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 version to 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 use swiftlint 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.