All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#assert#SetUpLinterTest('tex', 'cspell')
4 " We have to manually do our own variable reset because SetUpLinterTest calls
5 " ale#assert#ResetVariables, which specifically only resets variables that
6 " begin with ale_<filetype>_, per https://github.com/dense-analysis/ale/blob/76c2293e68a6cad3b192062743d25b8daa082205/autoload/ale/assert.vim#L256
8 " Took a lot of debugging and reading both junegunn/vader.vim and most ALE
9 " files to find this behavior
11 Save g:ale_cspell_executable
12 Save g:ale_cspell_use_global
13 Save g:ale_cspell_options
15 unlet! g:ale_cspell_executable
16 unlet! g:ale_cspell_use_global
17 unlet! g:ale_cspell_options
19 let g:ale_cspell_executable = 'cspell'
20 let g:ale_cspell_use_global = 0
21 let g:ale_cspell_options = ''
26 call ale#assert#TearDownLinterTest()
28 Execute(The global executable should be used when the local one cannot be found):
31 \ ale#Escape('cspell')
32 \ . ' lint --no-color --no-progress --no-summary --language-id="latex" -- stdin'
34 Execute(Should use the node_modules/.bin executable if available):
35 call ale#test#SetFilename('../test-files/cspell/node-modules/test.tex')
38 \ ale#path#Simplify(g:dir
39 \ . '/../test-files/cspell/node-modules/node_modules/.bin/cspell'),
40 \ ale#Escape(ale#path#Simplify(g:dir
41 \ . '/../test-files/cspell/node-modules/node_modules/.bin/cspell'))
42 \ . ' lint --no-color --no-progress --no-summary --language-id="latex" -- stdin'
44 Execute(Should use the node_modules/cspell executable if available):
45 call ale#test#SetFilename('../test-files/cspell/node-modules-2/test.tex')
48 \ ale#path#Simplify(g:dir
49 \ . '/../test-files/cspell/node-modules-2/node_modules/cspell/bin.js'),
50 \ (has('win32') ? 'node.exe ': '')
51 \ . ale#Escape(ale#path#Simplify(g:dir
52 \ . '/../test-files/cspell/node-modules-2/node_modules/cspell/bin.js'))
53 \ . ' lint --no-color --no-progress --no-summary --language-id="latex" -- stdin'
55 Execute(Should let users configure a global executable and override local paths):
56 let g:ale_cspell_executable = '/path/to/custom/cspell'
57 let g:ale_cspell_use_global = 1
60 \ '/path/to/custom/cspell',
61 \ ale#Escape('/path/to/custom/cspell')
62 \ . ' lint --no-color --no-progress --no-summary --language-id="latex" -- stdin'
64 Execute(Additional cspell options should be configurable):
65 call ale#test#SetFilename('../test-files/dummy')
67 let g:ale_cspell_options = '--foobar'
71 \ ale#Escape('cspell')
72 \ . ' lint --no-color --no-progress --no-summary --language-id="latex" --foobar -- stdin'
74 Execute(The language id should be tex when filetype is plaintex):
79 \ ale#Escape('cspell')
80 \ . ' lint --no-color --no-progress --no-summary --language-id="tex" -- stdin'
82 Execute(The language id should be equal to filetype when not tex or plaintex):
87 \ ale#Escape('cspell')
88 \ . ' lint --no-color --no-progress --no-summary --language-id="markdown" -- stdin'
94 \ ale#Escape('cspell')
95 \ . ' lint --no-color --no-progress --no-summary --language-id="asciidoc" -- stdin'
101 \ ale#Escape('cspell')
102 \ . ' lint --no-color --no-progress --no-summary --language-id="html" -- stdin'
104 Execute(The language id should not specified when filetype is empty):
109 \ ale#Escape('cspell')
110 \ . ' lint --no-color --no-progress --no-summary -- stdin'