mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Fix j2lint linter (#5065)
* fix option pymarkdown linter * fix-j2lint-linter
This commit is contained in:
@@ -33,9 +33,8 @@ function! ale_linters#markdown#pymarkdown#GetCommand(buffer) abort
|
|||||||
\ : ''
|
\ : ''
|
||||||
|
|
||||||
return ale#Escape(l:executable) . l:exec_args
|
return ale#Escape(l:executable) . l:exec_args
|
||||||
\ . ' '
|
\ . ale#Pad(ale#Var(a:buffer, 'markdown_pymarkdown_options'))
|
||||||
\ . ale#Var(a:buffer, 'markdown_pymarkdown_options')
|
\ . ' scan-stdin'
|
||||||
\ . 'scan-stdin'
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#markdown#pymarkdown#Handle(buffer, lines) abort
|
function! ale_linters#markdown#pymarkdown#Handle(buffer, lines) abort
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ Before:
|
|||||||
After:
|
After:
|
||||||
call ale#assert#TearDownLinterTest()
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The pycodestyle command callback should allow options):
|
||||||
|
let g:ale_jinja_j2lint_options = '--exclude=test*.j2'
|
||||||
|
|
||||||
|
AssertLinter 'j2lint',
|
||||||
|
\ ale#Escape('j2lint') . ' --exclude=test*.j2 %t'
|
||||||
|
|
||||||
Execute(The j2lint executable should be configurable):
|
Execute(The j2lint executable should be configurable):
|
||||||
let g:ale_jinja_j2lint_executable = '~/.local/bin/j2lint'
|
let g:ale_jinja_j2lint_executable = '~/.local/bin/j2lint'
|
||||||
|
|
||||||
@@ -36,6 +42,12 @@ Execute(Poetry is detected when jinja_j2lint_auto_poetry is set):
|
|||||||
AssertLinter 'poetry',
|
AssertLinter 'poetry',
|
||||||
\ ale#Escape('poetry') . ' run j2lint %t'
|
\ ale#Escape('poetry') . ' run j2lint %t'
|
||||||
|
|
||||||
|
Execute(Setting executable to 'uv' appends 'run j2lint'):
|
||||||
|
let g:ale_jinja_j2lint_executable = 'path/to/uv'
|
||||||
|
|
||||||
|
AssertLinter 'path/to/uv',
|
||||||
|
\ ale#Escape('path/to/uv') . ' run j2lint %t'
|
||||||
|
|
||||||
Execute(uv is detected when jinja_j2lint_auto_uv is set):
|
Execute(uv is detected when jinja_j2lint_auto_uv is set):
|
||||||
let g:ale_jinja_j2lint_auto_uv = 1
|
let g:ale_jinja_j2lint_auto_uv = 1
|
||||||
call ale#test#SetFilename('../test-files/python/uv/whatever.py')
|
call ale#test#SetFilename('../test-files/python/uv/whatever.py')
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ Execute(The pymarkdown command callback should return default string):
|
|||||||
AssertLinter 'pymarkdown', ale#Escape('pymarkdown') . ' scan-stdin'
|
AssertLinter 'pymarkdown', ale#Escape('pymarkdown') . ' scan-stdin'
|
||||||
|
|
||||||
Execute(The pycodestyle command callback should allow options):
|
Execute(The pycodestyle command callback should allow options):
|
||||||
let g:markdown_pymarkdown_options = '--exclude=test*.py'
|
let g:ale_markdown_pymarkdown_options = '--exclude=test*.py'
|
||||||
|
|
||||||
|
AssertLinter 'pymarkdown',
|
||||||
|
\ ale#Escape('pymarkdown') . ' --exclude=test*.py scan-stdin'
|
||||||
|
|
||||||
Execute(The pymarkdown executable should be configurable):
|
Execute(The pymarkdown executable should be configurable):
|
||||||
let g:ale_markdown_pymarkdown_executable = '~/.local/bin/pymarkdown'
|
let g:ale_markdown_pymarkdown_executable = '~/.local/bin/pymarkdown'
|
||||||
|
|||||||
Reference in New Issue
Block a user