Merge branch 'claytron-rubocop-formatter'

This commit is contained in:
Chiel ten Brinke 2017-01-20 10:31:33 +01:00
commit b92b0e3c5d
2 changed files with 11 additions and 1 deletions

View File

@ -191,6 +191,10 @@ Here is a list of formatprograms that are supported by default, and thus will be
Here is the link to the repository: https://github.com/erniebrodeur/ruby-beautify.
This beautifier developed and tested with ruby `2.0+`, so you can have weird results with earlier ruby versions.
* `rubocop` for __Ruby__.
It can be installed by running `gem install rubocop`.
Here is the link to the repository: https://github.com/bbatsov/rubocop
* `gofmt` for __Golang__.
The default golang formatting program is shipped with the golang distribution. Make sure `gofmt` is in your PATH (if golang is installed properly, it should be).
Here is the link to the installation: https://golang.org/doc/install

View File

@ -233,8 +233,14 @@ if !exists('g:formatdef_rbeautify')
let g:formatdef_rbeautify = '"rbeautify ".(&expandtab ? "-s -c ".shiftwidth() : "-t")'
endif
if !exists('g:formatdef_rubocop')
" The pipe to sed is required to remove some rubocop output that could not
" be suppressed.
let g:formatdef_rubocop = "'rubocop --auto-correct -o /dev/null -s '.bufname('%').' \| sed -n 2,\\$p'"
endif
if !exists('g:formatters_ruby')
let g:formatters_ruby = ['rbeautify']
let g:formatters_ruby = ['rbeautify', 'rubocop']
endif