mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-15 15:46:52 +08:00
Merge pull request #3261 from toastal/dhall
Enhanced Dhall fixer support
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
Before:
|
||||
call ale#assert#SetUpFixerTest('dhall', 'dhall')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownFixerTest()
|
||||
|
||||
Execute(The default command should be correct):
|
||||
AssertFixer
|
||||
\ { 'read_temporary_file': 1,
|
||||
\ 'command': ale#Escape('dhall') . ' format --inplace %t'
|
||||
\ }
|
||||
24
test/fixers/test_dhall_format_fixer_callback.vader
Normal file
24
test/fixers/test_dhall_format_fixer_callback.vader
Normal file
@@ -0,0 +1,24 @@
|
||||
Before:
|
||||
Save g:ale_dhall_executable
|
||||
Save g:ale_dhall_options
|
||||
|
||||
" Use an invalid global executable, so we don’t match it.
|
||||
let g:ale_dhall_executable = 'odd-dhall'
|
||||
let g:ale_dhall_options = '--ascii'
|
||||
|
||||
call ale#assert#SetUpFixerTest('dhall-format', 'dhall-format')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownFixerTest()
|
||||
|
||||
Execute(The dhall-format callback should return the correct options):
|
||||
call ale#test#SetFilename('../dhall_files/testfile.dhall')
|
||||
|
||||
AssertFixer
|
||||
\ {
|
||||
\ 'command': ale#Escape('odd-dhall')
|
||||
\ . ' --ascii'
|
||||
\ . ' format'
|
||||
\ . ' --inplace %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\ }
|
||||
24
test/fixers/test_dhall_freeze_fixer_callback.vader
Normal file
24
test/fixers/test_dhall_freeze_fixer_callback.vader
Normal file
@@ -0,0 +1,24 @@
|
||||
Before:
|
||||
Save g:ale_dhall_executable
|
||||
Save g:ale_dhall_options
|
||||
|
||||
" Use an invalid global executable, so we don’t match it.
|
||||
let g:ale_dhall_executable = 'odd-dhall'
|
||||
let g:ale_dhall_options = '--ascii'
|
||||
let g:ale_dhall_freeze_options = '--all'
|
||||
|
||||
call ale#assert#SetUpFixerTest('dhall-freeze', 'dhall-freeze')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownFixerTest()
|
||||
|
||||
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,
|
||||
\ }
|
||||
22
test/fixers/test_dhall_lint_fixer_callback.vader
Normal file
22
test/fixers/test_dhall_lint_fixer_callback.vader
Normal file
@@ -0,0 +1,22 @@
|
||||
Before:
|
||||
Save g:ale_dhall_executable
|
||||
Save g:ale_dhall_options
|
||||
|
||||
" Use an invalid global executable, so we don’t match it.
|
||||
let g:ale_dhall_executable = 'odd-dhall'
|
||||
let g:ale_dhall_options = '--ascii'
|
||||
|
||||
call ale#assert#SetUpFixerTest('dhall-lint', 'dhall-lint')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownFixerTest()
|
||||
|
||||
Execute(The dhall-lint callback should return the correct options):
|
||||
AssertFixer
|
||||
\ {
|
||||
\ 'command': ale#Escape('odd-dhall')
|
||||
\ . ' --ascii'
|
||||
\ . ' lint'
|
||||
\ . ' --inplace %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\ }
|
||||
Reference in New Issue
Block a user