mirror of
1
0
Fork 0
ultimate-vim/sources_non_forked/ale/autoload/ale/fixers/styler.vim

17 lines
555 B
VimL
Raw Normal View History

2019-05-17 10:09:13 -04:00
" Author: tvatter <thibault.vatter@gmail.com>
" Description: Fixing R files with styler.
call ale#Set('r_styler_executable', 'Rscript')
2019-11-16 10:28:42 -05:00
call ale#Set('r_styler_options', 'tidyverse_style()')
2019-05-17 10:09:13 -04:00
function! ale#fixers#styler#Fix(buffer) abort
return {
\ 'command': 'Rscript --vanilla -e '
\ . '"suppressPackageStartupMessages(library(styler));'
2019-11-16 10:28:42 -05:00
\ . 'style_file(commandArgs(TRUE), transformers = '
2019-05-17 10:09:13 -04:00
\ . ale#Var(a:buffer, 'r_styler_options') . ')"'
\ . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction