jish / pre-commit

A slightly improved pre-commit hook for git
https://jish.github.io/pre-commit/
Other
796 stars 96 forks source link

Only lint specific extensions for Rubocop. #222

Closed lunks closed 9 years ago

lunks commented 9 years ago

We were not escaping the . correctly when looking for a specific extension. This fixes it.

Just for a small context behind this fix, we have files named like script.coffee.erb and rubocop was trying to parse those files when it was not supposed to.

Let me know if the test is on the wrong location and where should I put it in case that's true.

mpapis commented 9 years ago

looks good, one question though, why double escape, wouldn't single escape be enough?

lunks commented 9 years ago

It wasn't. Not sure why, not much of a regex master myself :sweat_smile:

oddlyfunctional commented 9 years ago

That's because otherwise the slash would disappear when interpolating to the regex (instead of /\.rb/, it would be /.rb/).

mpapis commented 9 years ago

thank you!

@jish this fixes a bug - version bump needed

jish commented 9 years ago

Released v0.25.0 https://rubygems.org/gems/pre-commit

lunks commented 9 years ago

Already upgrade our app, thanks for the swift response! :)

Keep rocking!

On Sat, Aug 29, 2015 at 4:29 PM, Josh Lubaway notifications@github.com wrote:

Released v0.25.0 https://rubygems.org/gems/pre-commit

— Reply to this email directly or view it on GitHub https://github.com/jish/pre-commit/pull/222#issuecomment-136027962.