standardrb / standard

Ruby's bikeshed-proof linter and formatter 🚲
Other
2.71k stars 210 forks source link

Editor support for Emacs #47

Open searls opened 5 years ago

searls commented 5 years ago

Fork rubocop-emacs, maybe?

rosston commented 5 years ago

Adding support to Flycheck (either directly or via extension) might be a better option for Emacs support. Spacemacs uses it by default, so I think it's rather popular. And I think it would avoid the need to build a standardrb-mode.

rosston commented 5 years ago

Re Flycheck: it's probably worth noting that there probably won't be support for fixing anytime soon, judging by https://github.com/flycheck/flycheck/issues/530.

knu commented 5 years ago

I could write a formatter definition for format-all.

mkornblum commented 3 years ago

Howdy, updates for this issue:

@knu did indeed write a formatter, which is now part of format-all: https://github.com/lassik/emacs-format-all-the-code/pull/107

I got standardrb linting + auto format on save working yesterday with standardrb, the newest version of format-all, flycheck-standardrb, and the following config in a .dir-locals.el file in my project directory:

((ruby-mode
  (format-all-formatters ("Ruby" standardrb))
  (eval . (format-all-mode 1))
  (flycheck-disabled-checkers . 'ruby-rubocop)))

I'm using doom-emacs and the version of format-all currently included with it appears to be pretty old, so I had to explicitly install a newer version. There's an open issue about this on the doom emacs repo. Mentioning that here just because doom is quite popular these days!