Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested configs aren't applied when --path is provided. #1825

Closed
2 tasks done
bclymer opened this issue Sep 7, 2017 · 2 comments
Closed
2 tasks done

Nested configs aren't applied when --path is provided. #1825

bclymer opened this issue Sep 7, 2017 · 2 comments
Labels
wontfix Issues that became stale and were auto-closed by a bot.

Comments

@bclymer
Copy link

bclymer commented Sep 7, 2017

New Issue Checklist

Bug Report

Environment

  • SwiftLint version (run swiftlint version to be sure)?
    0.22.0
  • Installation method used (Homebrew, CocoaPods, building from source, etc)?
    Homebrew

Project structure

./Root.swift
./.swiftlint.yml
./Tests/Test.swift
./Tests/.swiftlint.yml

./Root.swift

public class Root {
    private let test = Int("1")!
    private let test2 = "" as! NSString
}

./.swiftlint.yml

disabled_rules:
 - force_unwrapping

./Tests/Test.swift

public class Test {
    private let test = Int("1")!
    private let test2 = "" as! NSString
}

./Tests/.swiftlint.yml

disabled_rules:
 - force_cast

Running swiftlint from ./ prints

Loading configuration from '.swiftlint.yml'
Linting Swift files in current working directory
Linting 'Root.swift' (1/2)
Linting 'Test.swift' (2/2)
/Users/brianclymer/Desktop/SwiftLintTest/Root.swift:3:28: error: Force Cast Violation: Force casts should be avoided. (force_cast)
Done linting! Found 1 violation, 1 serious in 2 files.

Running swiftlint --path Tests/Test.swift from ./ prints

Loading configuration from '.swiftlint.yml'
Linting Swift files at path Tests/Test.swift
Linting 'Test.swift' (1/1)
/Users/brianclymer/Desktop/SwiftLintTest/Tests/Test.swift:3:28: error: Force Cast Violation: Force casts should be avoided. (force_cast)
Done linting! Found 1 violation, 1 serious in 1 file.

The bug is that Tests.swift shouldn't report any errors, as the nested configuration should be loaded, but isn't. This only happens when --path is provided.

@bclymer bclymer changed the title Nested configs aren't applied with --path is provided. Nested configs aren't applied when --path is provided. Sep 7, 2017
@SDGGiesbrecht
Copy link
Contributor

@bclymer,

There was a lot of discussion about this about a month ago. The discussion was scattered throughout several closed issues and pull requests, so I am not surprised you did not find it in your search. I am not aware that the maintainers ever published a decision on what --path even should do.

I recommend reading this in‐depth comment. Then post here making a case for your understanding of the purpose of --path. (It looks like probably an instance of situation A from that post?) Then wait for a response from a maintainer (of which I am not).

@stale
Copy link

stale bot commented Nov 8, 2020

This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!

@stale stale bot added the wontfix Issues that became stale and were auto-closed by a bot. label Nov 8, 2020
@stale stale bot closed this as completed Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix Issues that became stale and were auto-closed by a bot.
Projects
None yet
Development

No branches or pull requests

2 participants