parent
bd07d04670
commit
c2ceb9e085
@ -1,6 +1,22 @@
|
|||||||
" Author: Vincent Lequertier <https://github.com/SkySymbol>
|
" Author: Vincent Lequertier <https://github.com/SkySymbol>
|
||||||
" Description: This file adds support for checking perl syntax
|
" Description: This file adds support for checking perl syntax
|
||||||
|
|
||||||
|
let g:ale_perl_perl_executable =
|
||||||
|
\ get(g:, 'ale_perl_perl_executable', 'perl')
|
||||||
|
|
||||||
|
let g:ale_perl_perl_options =
|
||||||
|
\ get(g:, 'ale_perl_perl_options', '-X -c -Mwarnings -Ilib')
|
||||||
|
|
||||||
|
function! ale_linters#perl#perl#GetExecutable(buffer) abort
|
||||||
|
return g:ale_perl_perl_executable
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ale_linters#perl#perl#GetCommand(buffer) abort
|
||||||
|
return ale_linters#perl#perl#GetExecutable(a:buffer)
|
||||||
|
\ . ' ' . g:ale_perl_perl_options
|
||||||
|
\ . ' %t'
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale_linters#perl#perl#Handle(buffer, lines) abort
|
function! ale_linters#perl#perl#Handle(buffer, lines) abort
|
||||||
let l:pattern = '\(.\+\) at \(.\+\) line \(\d\+\)'
|
let l:pattern = '\(.\+\) at \(.\+\) line \(\d\+\)'
|
||||||
let l:output = []
|
let l:output = []
|
||||||
@ -32,8 +48,8 @@ endfunction
|
|||||||
|
|
||||||
call ale#linter#Define('perl', {
|
call ale#linter#Define('perl', {
|
||||||
\ 'name': 'perl',
|
\ 'name': 'perl',
|
||||||
\ 'executable': 'perl',
|
\ 'executable_callback': 'ale_linters#perl#perl#GetExecutable',
|
||||||
\ 'output_stream': 'both',
|
\ 'output_stream': 'both',
|
||||||
\ 'command': 'perl -X -c -Mwarnings -Ilib',
|
\ 'command_callback': 'ale_linters#perl#perl#GetCommand',
|
||||||
\ 'callback': 'ale_linters#perl#perl#Handle',
|
\ 'callback': 'ale_linters#perl#perl#Handle',
|
||||||
\})
|
\})
|
||||||
|
20
doc/ale.txt
20
doc/ale.txt
@ -41,6 +41,8 @@ CONTENTS *ale-contents*
|
|||||||
4.29. xo..............................|ale-linter-options-xo|
|
4.29. xo..............................|ale-linter-options-xo|
|
||||||
4.30. javac...........................|ale-linter-options-javac|
|
4.30. javac...........................|ale-linter-options-javac|
|
||||||
4.31. yamllint........................|ale-linter-options-yamllint|
|
4.31. yamllint........................|ale-linter-options-yamllint|
|
||||||
|
4.32. cmakelint.......................|ale-linter-options-cmakelint|
|
||||||
|
4.33. perl-perl.......................|ale-linter-options-perl-perl|
|
||||||
5. Linter Integration Notes.............|ale-linter-integration|
|
5. Linter Integration Notes.............|ale-linter-integration|
|
||||||
5.1. merlin..........................|ale-linter-integration-ocaml-merlin|
|
5.1. merlin..........................|ale-linter-integration-ocaml-merlin|
|
||||||
5.2. rust.............................|ale-integration-rust|
|
5.2. rust.............................|ale-integration-rust|
|
||||||
@ -1097,6 +1099,24 @@ g:ale_cmake_cmakelint_options *g:ale_cmake_cmakelint_options*
|
|||||||
|
|
||||||
This variable can be set to pass additional options to cmakelint.
|
This variable can be set to pass additional options to cmakelint.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
4.33. perl-perl *ale-linter-options-perl-perl*
|
||||||
|
|
||||||
|
g:ale_perl_perl_executable *g:ale_perl_perl_executable*
|
||||||
|
|
||||||
|
Type: |String|
|
||||||
|
Default: `'perl'`
|
||||||
|
|
||||||
|
This variable can be changed to modify the executable used for linting perl.
|
||||||
|
|
||||||
|
|
||||||
|
g:ale_perl_perl_options *g:ale_perl_perl_options*
|
||||||
|
|
||||||
|
Type: |String|
|
||||||
|
Default: `'-X -c -Mwarnings -Ilib'`
|
||||||
|
|
||||||
|
This variable can be changed to alter the command-line arguments to the perl
|
||||||
|
invocation.
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
5. Linter Integration Notes *ale-linter-integration*
|
5. Linter Integration Notes *ale-linter-integration*
|
||||||
|
Loading…
Reference in New Issue
Block a user