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

Opt out of --config #160

Closed
dirtyhabits97 opened this issue Mar 30, 2021 · 1 comment · Fixed by #161
Closed

Opt out of --config #160

dirtyhabits97 opened this issue Mar 30, 2021 · 1 comment · Fixed by #161

Comments

@dirtyhabits97
Copy link
Collaborator

Given the breaking changes to --config in the latest versions of SwiftLint, I was wondering if we could opt out of passing a config file.

In my case i have a couple of custom_rules defined in the root project's .swiftlint.yml, but i need to disable some of them in one of the subdirectories root/foo/bar/.swiftlint.yml. This worked great with SwiftLint v0.39.0, but with the changes I mentioned it doesn't work anymore. Opting out of passing a --config would fix my issue.

I think we could achieve that by updating this validation:

config_file_path = if config_file
config_file
elsif !lint_all_files && File.file?('.swiftlint.yml')
File.expand_path('.swiftlint.yml')
end

Lmk what you guys think. I wouldn't mind helping with a PR.

@ashfurrow
Copy link
Owner

Yeah, this sounds like a great idea! It seems like removing the config_file_path if it's unspecified would work better with how SwiftLint is operating. ie: it is SwiftLint's job to find the config file if it's not specified (not ours).

A PR sounds wonderful, thank you 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants