jish / pre-commit

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

how to run rubocop against changes in non-.rb files #274

Closed lwille closed 4 years ago

lwille commented 6 years ago

One of my projects has some executables which lack the .rb extension. These files are not matched by pre-commit.

In my old "manual" hook setup I was using file -I which reliably detects the exact mime type of executable files if they have a proper shebang:

➜ file -I bin/pre-commit
bin/pre-commit: text/x-ruby; charset=us-ascii

What do people think about this?

jish commented 6 years ago

Hi @lwille,

The only thing I would be worried about here is degrading performance. So if the matching is opt-in by default, then I believe it should be safe to include without affecting out-of-the-box performance.