From ce0b14979ea7429f07b6ca496333f72d93a8d013 Mon Sep 17 00:00:00 2001 From: Thibault Vatter Date: Tue, 23 Apr 2019 14:44:26 -0400 Subject: 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 --- test/fixers/test_styler_fixer_callback.vader | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/fixers/test_styler_fixer_callback.vader (limited to 'test/fixers') diff --git a/test/fixers/test_styler_fixer_callback.vader b/test/fixers/test_styler_fixer_callback.vader new file mode 100644 index 00000000..85e45c1d --- /dev/null +++ b/test/fixers/test_styler_fixer_callback.vader @@ -0,0 +1,21 @@ +Before: + call ale#test#SetDirectory('/testplugin/test/fixers') + +After: + Restore + + call ale#test#RestoreDirectory() + +Execute(The styler callback should include custom styler options): + let g:ale_r_styler_options = "a_custom_option" + + AssertEqual + \ { + \ 'command': 'Rscript --vanilla -e ' + \ . '"suppressPackageStartupMessages(library(styler));' + \ . 'style_file(commandArgs(TRUE), style = ' + \ . 'a_custom_option)"' + \ . ' %t', + \ 'read_temporary_file': 1, + \ }, + \ ale#fixers#styler#Fix(bufnr('')) -- cgit v1.2.3