rubocop / guard-rubocop

Guard plugin for RuboCop
MIT License
262 stars 55 forks source link

allow custom cmd option for rubocop #48

Closed desheikh closed 3 years ago

desheikh commented 3 years ago

Add a custom command option for when you want to use bundled or bin stubbed version of rubocop.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 447927375


Totals Coverage Status
Change from base Build 330803147: 0.0%
Covered Lines: 131
Relevant Lines: 131

💛 - Coveralls
desheikh commented 3 years ago

@bbatsov would you be able to review this?

desheikh commented 3 years ago

Gentle bump. @koic perhaps if you are able?

freesteph commented 3 years ago

Also registering interest for this simple but essential feature.

databyte commented 3 years ago

Yes, works great with spring to generate a binstub for rubocop so you can start executing it even faster.

databyte commented 3 years ago

I'd also like to just execute rubocop within guard for modified files only. Example cmd:

guard :rubocop, cmd: "git ls-files -m | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bin/rubocop" do
  watch(%r{.+\.rb$})
  watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
end
bbatsov commented 3 years ago

Ops, seems I had unwatched this repo by accident and didn't see the previous messages. Sorry about that!

This change looks good indeed, but should also be mentioned in the changelog and the README (otherwise it's unlikely that someone will find it).

desheikh commented 3 years ago

Ops, seems I had unwatched this repo by accident and didn't see the previous messages. Sorry about that!

This change looks good indeed, but should also be mentioned in the changelog and the README (otherwise it's unlikely that someone will find it).

Thanks Team! I've updated the README.

bbatsov commented 3 years ago

Hmm, something's wrong with the CI build.

databyte commented 3 years ago

Looks like that issue is very intermittent from multiple posts to coveralls.

References:

bbatsov commented 3 years ago

Okay, I'll merge this and I'll cut a new release after we update the CI for Ruby 3.

koic commented 3 years ago

Or I can update the CI over this weekend and cut a new release. (coverall's issue may be commented out as a workaround)

koic commented 3 years ago

I've released v1.5.0. Thank you! https://github.com/rubocop/guard-rubocop/releases/tag/v1.5.0