Skip to content

Running rubocop without bundle exec significantly reduces run time (w/ benchmarks) #410

Answered by mrexox
mculp asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! Very cool suggestion, I really like the boost using rubocop --server. This is really useful!

I want to answer a few questions:

  1. Lefthook uses a hook template which finds the lefthook executable and runs it. Since lefthook is distributed as NPM package, Ruby Gem, simple binary, it can be missing in $PATH, so that's why we do bundle exec, pnpm, npx, and check node_modules. Adding pnpm was a new thing in last released version, and you might have updated lefthook recently, so this change appeared.
  2. You can provide a fail_text with instructions to install rubocop globally :) Or you can create a more sophisticated solution providing not a command, but a script, which checks for rubocop and …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mculp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants