ashfurrow / danger-ruby-swiftlint

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

Calling Lint on two different directories fails because of wrong path #142

Open igorkulman opened 4 years ago

igorkulman commented 4 years ago

I have a sources with project1 and project2, so relative paths from he root to my projects are sources/project1 and sources/project2.

My config looks like this

swiftlint.verbose = true
swiftlint.config_file = '.swiftlint.yml'
swiftlint.directory = "sources/project1"
swiftlint.lint_files(inline_mode: true, fail_on_error: true)

swiftlint.verbose = true
swiftlint.config_file = '.swiftlint.yml'
swiftlint.directory = "sources/project2"
swiftlint.lint_files(inline_mode: true, fail_on_error: true)

The first linting works fine but the second fails, trying to to lint sources/project1/sources/project2.

I would expect the path to be "reset" after doing the first linting s the second linting does not fail

ashfurrow commented 4 years ago

Hmm! I've never tried running it twice in one run. Hmm. I don't have a tonne of time to look into this, but the code is here and I'd love to review a pull request 🙇 https://github.com/ashfurrow/danger-ruby-swiftlint/blob/master/lib/danger_plugin.rb