mirror of
https://github.com/dense-analysis/ale.git
synced 2026-11-19 02:01:03 +08:00
Add a fixer for r based on the styler package (#2401)
* Add styler as a new fixer for R files * Add to the list of supported tools * Add documentation
This commit is contained in:
1 parent
893ac34cca
commit
ce0b14979e
7 files changed
+61
No files matched your search
@@ -0,0 +1,16 @@
|
||||
" Author: tvatter <thibault.vatter@gmail.com>
|
||||
" Description: Fixing R files with styler.
|
||||
|
||||
call ale#Set('r_styler_executable', 'Rscript')
|
||||
call ale#Set('r_styler_options', 'tidyverse_style')
|
||||
|
||||
function! ale#fixers#styler#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': 'Rscript --vanilla -e '
|
||||
\ . '"suppressPackageStartupMessages(library(styler));'
|
||||
\ . 'style_file(commandArgs(TRUE), style = '
|
||||
\ . ale#Var(a:buffer, 'r_styler_options') . ')"'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in new issue
Block a user