Skip to content

Commit

Permalink
Dhall fixes: use stdin, doc errors (#3868)
Browse files Browse the repository at this point in the history
* purs-tidy

* Dhall fixes: use stdin, docs errors
  • Loading branch information
toastal authored Aug 9, 2021
1 parent 9264ffd commit a099fe2
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 37 deletions.
7 changes: 2 additions & 5 deletions autoload/ale/fixers/dhall_format.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 4 additions & 8 deletions autoload/ale/fixers/dhall_freeze.vim
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
" Author: toastal <[email protected]>
" Description: Dhall's package freezing
" Description: Dhalls 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
7 changes: 2 additions & 5 deletions autoload/ale/fixers/dhall_lint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions doc/ale-dhall.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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'
<

===============================================================================
Expand All @@ -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'
<

===============================================================================
Expand Down
6 changes: 2 additions & 4 deletions test/fixers/test_dhall_format_fixer_callback.vader
Original file line number Diff line number Diff line change
Expand Up @@ -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'
\ }
8 changes: 3 additions & 5 deletions test/fixers/test_dhall_freeze_fixer_callback.vader
Original file line number Diff line number Diff line change
Expand Up @@ -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'
\ }
6 changes: 2 additions & 4 deletions test/fixers/test_dhall_lint_fixer_callback.vader
Original file line number Diff line number Diff line change
Expand Up @@ -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'
\ }

0 comments on commit a099fe2

Please sign in to comment.