summaryrefslogtreecommitdiff
path: root/ale_linters/perl
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-05-28 12:51:06 +0100
committerw0rp <devw0rp@gmail.com>2018-05-28 12:51:06 +0100
commitcd0dc0a2273883109f5a7ccd4bb2b7e15f3630df (patch)
tree6c20f0b93d7c99b93bcf39e724a1225481b2edfc /ale_linters/perl
parenteaf35bc6115694def260a1790b8eb62559af6785 (diff)
downloadale-cd0dc0a2273883109f5a7ccd4bb2b7e15f3630df.zip
Fix #1611 - Fix perlcritic escaping on Windows
Diffstat (limited to 'ale_linters/perl')
-rw-r--r--ale_linters/perl/perlcritic.vim19
1 files changed, 7 insertions, 12 deletions
diff --git a/ale_linters/perl/perlcritic.vim b/ale_linters/perl/perlcritic.vim
index 24f7eb86..e91c8a03 100644
--- a/ale_linters/perl/perlcritic.vim
+++ b/ale_linters/perl/perlcritic.vim
@@ -18,9 +18,9 @@ function! ale_linters#perl#perlcritic#GetExecutable(buffer) abort
endfunction
function! ale_linters#perl#perlcritic#GetProfile(buffer) abort
-
" first see if we've been overridden
let l:profile = ale#Var(a:buffer, 'perl_perlcritic_profile')
+
if l:profile is? ''
return ''
endif
@@ -31,6 +31,7 @@ endfunction
function! ale_linters#perl#perlcritic#GetCommand(buffer) abort
let l:critic_verbosity = '%l:%c %m\n'
+
if ale#Var(a:buffer, 'perl_perlcritic_showrules')
let l:critic_verbosity = '%l:%c %m [%p]\n'
endif
@@ -38,17 +39,11 @@ function! ale_linters#perl#perlcritic#GetCommand(buffer) abort
let l:profile = ale_linters#perl#perlcritic#GetProfile(a:buffer)
let l:options = ale#Var(a:buffer, 'perl_perlcritic_options')
- let l:command = ale#Escape(ale_linters#perl#perlcritic#GetExecutable(a:buffer))
- \ . " --verbose '". l:critic_verbosity . "' --nocolor"
-
- if l:profile isnot? ''
- let l:command .= ' --profile ' . ale#Escape(l:profile)
- endif
- if l:options isnot? ''
- let l:command .= ' ' . l:options
- endif
-
- return l:command
+ return ale#Escape(ale_linters#perl#perlcritic#GetExecutable(a:buffer))
+ \ . ' --verbose ' . ale#Escape(l:critic_verbosity)
+ \ . ' --nocolor'
+ \ . (!empty(l:profile) ? ' --profile ' . ale#Escape(l:profile) : '')
+ \ . (!empty(l:options) ? ' ' . l:options : '')
endfunction