From a099fe24b2e898c93c0aa4391e5a5631932684a6 Mon Sep 17 00:00:00 2001 From: toastal <561087+toastal@users.noreply.github.com> Date: Mon, 9 Aug 2021 11:43:50 +0000 Subject: [PATCH] Dhall fixes: use stdin, doc errors (#3868) * purs-tidy * Dhall fixes: use stdin, docs errors --- autoload/ale/fixers/dhall_format.vim | 7 ++----- autoload/ale/fixers/dhall_freeze.vim | 12 ++++-------- autoload/ale/fixers/dhall_lint.vim | 7 ++----- doc/ale-dhall.txt | 12 ++++++------ test/fixers/test_dhall_format_fixer_callback.vader | 6 ++---- test/fixers/test_dhall_freeze_fixer_callback.vader | 8 +++----- test/fixers/test_dhall_lint_fixer_callback.vader | 6 ++---- 7 files changed, 21 insertions(+), 37 deletions(-) diff --git a/autoload/ale/fixers/dhall_format.vim b/autoload/ale/fixers/dhall_format.vim index 0812a186..4f12abc8 100644 --- a/autoload/ale/fixers/dhall_format.vim +++ b/autoload/ale/fixers/dhall_format.vim @@ -3,12 +3,9 @@ " function! ale#fixers#dhall_format#Fix(buffer) abort let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer) - let l:command = l:executable - \ . ' format' - \ . ' --inplace %t' return { - \ 'command': l:command, - \ 'read_temporary_file': 1, + \ 'command': l:executable + \ . ' format' \} endfunction diff --git a/autoload/ale/fixers/dhall_freeze.vim b/autoload/ale/fixers/dhall_freeze.vim index e029a83d..ff54482d 100644 --- a/autoload/ale/fixers/dhall_freeze.vim +++ b/autoload/ale/fixers/dhall_freeze.vim @@ -1,18 +1,14 @@ " Author: toastal -" Description: Dhall's package freezing +" Description: Dhall’s package freezing call ale#Set('dhall_freeze_options', '') function! ale#fixers#dhall_freeze#Freeze(buffer) abort let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer) - let l:command = l:executable - \ . ' freeze' - \ . ale#Pad(ale#Var(a:buffer, 'dhall_freeze_options')) - \ . ' --inplace %t' - return { - \ 'command': l:command, - \ 'read_temporary_file': 1, + \ 'command': l:executable + \ . ' freeze' + \ . ale#Pad(ale#Var(a:buffer, 'dhall_freeze_options')) \} endfunction diff --git a/autoload/ale/fixers/dhall_lint.vim b/autoload/ale/fixers/dhall_lint.vim index 18fe9788..149a6581 100644 --- a/autoload/ale/fixers/dhall_lint.vim +++ b/autoload/ale/fixers/dhall_lint.vim @@ -3,12 +3,9 @@ function! ale#fixers#dhall_lint#Fix(buffer) abort let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer) - let l:command = l:executable - \ . ' lint' - \ . ' --inplace %t' return { - \ 'command': l:command, - \ 'read_temporary_file': 1, + \ 'command': l:executable + \ . ' lint' \} endfunction diff --git a/doc/ale-dhall.txt b/doc/ale-dhall.txt index 44b0bf32..9b997b9e 100644 --- a/doc/ale-dhall.txt +++ b/doc/ale-dhall.txt @@ -6,15 +6,15 @@ g:ale_dhall_executable *g:ale_dhall_executable* Type: |String| Default: `'dhall'` -g:ale_dhall_options g:ale_dhall_options - b:ale_dhall_options +g:ale_dhall_options *g:ale_dhall_options* + *b:ale_dhall_options* Type: |String| Default: `''` This variable can be set to pass additional options to the 'dhall` executable. This is shared with `dhall-freeze` and `dhall-lint`. > - let g:dhall_options = '--ascii' + let g:ale_dhall_options = '--ascii' < =============================================================================== @@ -30,15 +30,15 @@ dhall-freeze *ale-dhall-freeze* Dhall (https://dhall-lang.org/) -g:ale_dhall_freeze_options g:ale_dhall_freeze_options - b:ale_dhall_freeze_options +g:ale_dhall_freeze_options *g:ale_dhall_freeze_options* + *b:ale_dhall_freeze_options* Type: |String| Default: `''` This variable can be set to pass additional options to the 'dhall freeze` executable. > - let g:dhall_freeze_options = '--all' + let g:ale_dhall_freeze_options = '--all' < =============================================================================== diff --git a/test/fixers/test_dhall_format_fixer_callback.vader b/test/fixers/test_dhall_format_fixer_callback.vader index 8d6c7651..8fa2fe7c 100644 --- a/test/fixers/test_dhall_format_fixer_callback.vader +++ b/test/fixers/test_dhall_format_fixer_callback.vader @@ -17,8 +17,6 @@ Execute(The dhall-format callback should return the correct options): AssertFixer \ { \ 'command': ale#Escape('odd-dhall') - \ . ' --ascii' - \ . ' format' - \ . ' --inplace %t', - \ 'read_temporary_file': 1, + \ . ' --ascii' + \ . ' format' \ } diff --git a/test/fixers/test_dhall_freeze_fixer_callback.vader b/test/fixers/test_dhall_freeze_fixer_callback.vader index c6e94ec1..02473697 100644 --- a/test/fixers/test_dhall_freeze_fixer_callback.vader +++ b/test/fixers/test_dhall_freeze_fixer_callback.vader @@ -16,9 +16,7 @@ Execute(The dhall-freeze callback should return the correct options): AssertFixer \ { \ 'command': ale#Escape('odd-dhall') - \ . ' --ascii' - \ . ' freeze' - \ . ' --all' - \ . ' --inplace %t', - \ 'read_temporary_file': 1, + \ . ' --ascii' + \ . ' freeze' + \ . ' --all' \ } diff --git a/test/fixers/test_dhall_lint_fixer_callback.vader b/test/fixers/test_dhall_lint_fixer_callback.vader index 5a1d6488..e2054eb0 100644 --- a/test/fixers/test_dhall_lint_fixer_callback.vader +++ b/test/fixers/test_dhall_lint_fixer_callback.vader @@ -15,8 +15,6 @@ Execute(The dhall-lint callback should return the correct options): AssertFixer \ { \ 'command': ale#Escape('odd-dhall') - \ . ' --ascii' - \ . ' lint' - \ . ' --inplace %t', - \ 'read_temporary_file': 1, + \ . ' --ascii' + \ . ' lint' \ }