I want ruby-rubocop
Flycheck syntax checker to execute bundle exec rubocop
instead of just rubocop
.
What I've tried:
(setq flycheck-ruby-rubocop-executable "bundle exec rubocop")
Results in following error:
Error while checking syntax automatically: (error "Output file descriptor of flycheck-ruby-rubocop is closed")
(flycheck-set-checker-executable 'ruby-rubocop "bundle exec rubocop")
I get error:
user-error: bundle exec rubocop is no executable
-
(setq flycheck-command-wrapper-function (lambda (command) (append '("bundle" "exec") command)))
It broke all checkers, because now it appends "bundle exec" to all checkers, not only ruby-rubocop, and it didn't work in ruby buffer (it still used
rubocop
withoutbundle exec
). I don't know how to make this variable buffer-local.