ashfurrow / danger-ruby-swiftlint

A Danger plugin for SwiftLint.
https://rubygems.org/gems/danger-swiftlint
MIT License
203 stars 80 forks source link

Opt out of --config #160

Closed dirtyhabits97 closed 3 years ago

dirtyhabits97 commented 3 years ago

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: https://github.com/ashfurrow/danger-ruby-swiftlint/blob/92cf9a9c5f904f510c811ff422ced878f7973521/lib/danger_plugin.rb#L70-L74

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

ashfurrow commented 3 years ago

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 🙇