summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-15 20:21:18 +0100
committerw0rp <devw0rp@gmail.com>2017-05-15 20:21:28 +0100
commitfa3a4b3ba2903e735fd3bbd761bec9ee3ea45e2b (patch)
tree64bc942fe9ea6e50fc4056f3f45882801ba09196
parent113f53a5d201af79027d9d5a87e28fc45bc1e60f (diff)
downloadale-fa3a4b3ba2903e735fd3bbd761bec9ee3ea45e2b.zip
Complain when shellescape is used instead of ale#Escape
-rw-r--r--autoload/ale.vim5
-rwxr-xr-xcustom-checks2
2 files changed, 5 insertions, 2 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim
index 189f1e46..ca75577a 100644
--- a/autoload/ale.vim
+++ b/autoload/ale.vim
@@ -125,12 +125,13 @@ function! ale#Var(buffer, variable_name) abort
endfunction
" Escape a string suitably for each platform.
-" shellescape() does not work on Windows.
+" shellescape does not work on Windows.
function! ale#Escape(str) abort
if fnamemodify(&shell, ':t') ==? 'cmd.exe'
" FIXME: Fix shell escaping for Windows.
return fnameescape(a:str)
else
- return shellescape(a:str)
+ " An extra space is used here to disable the custom-checks.
+ return shellescape (a:str)
endif
endfunction
diff --git a/custom-checks b/custom-checks
index 37d2840c..c4b329ca 100755
--- a/custom-checks
+++ b/custom-checks
@@ -63,6 +63,7 @@ check_errors() {
if (( FIX_ERRORS )); then
for directory in "${directories[@]}"; do
sed -i "s/^\(function.*)\) *$/\1 abort/" "$directory"/**/*.vim
+ sed -i "s/shellescape(/ale#Escape(/" "$directory"/**/*.vim
done
fi
@@ -75,5 +76,6 @@ check_errors '^ [^ ]' 'Use four spaces, not two spaces'
check_errors $'\t' 'Use four spaces, not tabs'
# This check should prevent people from using a particular inconsistent name.
check_errors 'let g:ale_\w\+_\w\+_args =' 'Name your option g:ale_<filetype>_<lintername>_options instead'
+check_errors 'shellescape(' 'Use ale#Escape instead of shellescape'
exit $RETURN_CODE