SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

Ignore absence of a non-initial local config instead of falling back to default.

Open kohtenko opened this issue 1 year ago • 1 comments

This change is helpful for Swift Package Manager (SPM) users. When one sets up the parent config to be shared between packages and keeps it in a working directory like following:

- WorkingDirectory
   - parent_config.yml
   - Package1
      - .swiftlint.yaml
      - ... 
   - Package2
      - .swiftlint.yaml
      - ... 
   - .... 

The current configuration works as expected. The challenge comes when the package is not local anymore (not in active development anymore). SPM checks out the repository in project's DerivedData instead, and no parent config is available at that new folder structure. Swiftlint plugin runs normally by SPM, but the config is now corrupted and fallback to default, which might bring unexpected warnings and errors.

kohtenko avatar Dec 29 '23 19:12 kohtenko

17 Messages
:book: Linting Aerial with this PR took 1.01s vs 1.0s on main (1% slower)
:book: Linting Alamofire with this PR took 1.43s vs 1.45s on main (1% faster)
:book: Linting Brave with this PR took 8.37s vs 8.41s on main (0% faster)
:book: Linting DuckDuckGo with this PR took 4.48s vs 4.46s on main (0% slower)
:book: Linting Firefox with this PR took 11.55s vs 11.48s on main (0% slower)
:book: Linting Kickstarter with this PR took 10.18s vs 10.15s on main (0% slower)
:book: Linting Moya with this PR took 0.57s vs 0.57s on main (0% slower)
:book: Linting NetNewsWire with this PR took 2.82s vs 2.79s on main (1% slower)
:book: Linting Nimble with this PR took 0.82s vs 0.83s on main (1% faster)
:book: Linting PocketCasts with this PR took 8.3s vs 8.29s on main (0% slower)
:book: Linting Quick with this PR took 0.38s vs 0.38s on main (0% slower)
:book: Linting Realm with this PR took 5.12s vs 5.16s on main (0% faster)
:book: Linting Sourcery with this PR took 2.56s vs 2.54s on main (0% slower)
:book: Linting Swift with this PR took 5.05s vs 4.98s on main (1% slower)
:book: Linting VLC with this PR took 1.37s vs 1.37s on main (0% slower)
:book: Linting Wire with this PR took 18.77s vs 18.81s on main (0% faster)
:book: Linting WordPress with this PR took 12.15s vs 12.18s on main (0% faster)

Generated by :no_entry_sign: Danger

SwiftLintBot avatar Dec 29 '23 19:12 SwiftLintBot

The change makes sense to me.

@mildm8nnered: I would like to check with you as the configuration expert. Please have a look.

I think this seems reasonable.

mildm8nnered avatar Mar 03 '24 22:03 mildm8nnered

Danger doesn't like merge commits. Please rebase your branch onto main instead of merging main in.

SimplyDanny avatar Mar 09 '24 13:03 SimplyDanny