Switch from style to transformers (#2838)
* Switch to transformers for styler * Adapt unit test too
This commit is contained in:
parent
a273b9cf4a
commit
db6b1b5ecc
2 changed files with 3 additions and 3 deletions
|
@ -2,13 +2,13 @@
|
||||||
" Description: Fixing R files with styler.
|
" Description: Fixing R files with styler.
|
||||||
|
|
||||||
call ale#Set('r_styler_executable', 'Rscript')
|
call ale#Set('r_styler_executable', 'Rscript')
|
||||||
call ale#Set('r_styler_options', 'tidyverse_style')
|
call ale#Set('r_styler_options', 'tidyverse_style()')
|
||||||
|
|
||||||
function! ale#fixers#styler#Fix(buffer) abort
|
function! ale#fixers#styler#Fix(buffer) abort
|
||||||
return {
|
return {
|
||||||
\ 'command': 'Rscript --vanilla -e '
|
\ 'command': 'Rscript --vanilla -e '
|
||||||
\ . '"suppressPackageStartupMessages(library(styler));'
|
\ . '"suppressPackageStartupMessages(library(styler));'
|
||||||
\ . 'style_file(commandArgs(TRUE), style = '
|
\ . 'style_file(commandArgs(TRUE), transformers = '
|
||||||
\ . ale#Var(a:buffer, 'r_styler_options') . ')"'
|
\ . ale#Var(a:buffer, 'r_styler_options') . ')"'
|
||||||
\ . ' %t',
|
\ . ' %t',
|
||||||
\ 'read_temporary_file': 1,
|
\ 'read_temporary_file': 1,
|
||||||
|
|
|
@ -13,7 +13,7 @@ Execute(The styler callback should include custom styler options):
|
||||||
\ {
|
\ {
|
||||||
\ 'command': 'Rscript --vanilla -e '
|
\ 'command': 'Rscript --vanilla -e '
|
||||||
\ . '"suppressPackageStartupMessages(library(styler));'
|
\ . '"suppressPackageStartupMessages(library(styler));'
|
||||||
\ . 'style_file(commandArgs(TRUE), style = '
|
\ . 'style_file(commandArgs(TRUE), transformers = '
|
||||||
\ . 'a_custom_option)"'
|
\ . 'a_custom_option)"'
|
||||||
\ . ' %t',
|
\ . ' %t',
|
||||||
\ 'read_temporary_file': 1,
|
\ 'read_temporary_file': 1,
|
||||||
|
|
Reference in a new issue