Emacs minor-mode to format Ruby code with rubocopfmt on save.
Core parts of rubocopfmt-mode are borrowed from go-mode and it's invocation of gofmt.
rubocopfmt-mode
go-mode
gofmt
Install rubocopfmt:
gem install rubocopfmt --pre
Drop rubocopfmt.el somewhere into you load-path. I favour the folder ~/.emacs.d/vendor:
rubocopfmt.el
load-path
~/.emacs.d/vendor
(add-to-list 'load-path "~/.emacs.d/vendor") (require 'rubocopfmt)
To enable formatting ruby-mode buffers with rubocopfmt on save, simply enable rubocop-mode within ruby-mode with something like this in your config:
ruby-mode
rubocop-mode
(add-hook 'ruby-mode-hook #'rubocopfmt-mode)
rubocopfmt