summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-08 22:59:25 +0100
committerw0rp <devw0rp@gmail.com>2017-05-08 22:59:25 +0100
commit6ea00af6895e111320a2047f43f94792a46b6cea (patch)
tree8a941fa08834e5dd512f3136b3c9b836ebf1b3d4 /ale_linters
parent28c6ec9cad3064966ff70c9da95c96364118eb57 (diff)
downloadale-6ea00af6895e111320a2047f43f94792a46b6cea.zip
#540 Fix shell escaping pretty much everywhere
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/asm/gcc.vim2
-rw-r--r--ale_linters/c/clang.vim2
-rw-r--r--ale_linters/c/gcc.vim2
-rw-r--r--ale_linters/cpp/clang.vim2
-rw-r--r--ale_linters/cpp/gcc.vim2
-rw-r--r--ale_linters/css/csslint.vim2
-rw-r--r--ale_linters/d/dmd.vim4
-rw-r--r--ale_linters/elm/make.vim2
-rw-r--r--ale_linters/erlang/erlc.vim2
-rw-r--r--ale_linters/go/gometalinter.vim2
-rw-r--r--ale_linters/java/javac.vim7
-rw-r--r--ale_linters/javascript/eslint.vim2
-rw-r--r--ale_linters/javascript/flow.vim2
-rw-r--r--ale_linters/javascript/jshint.vim4
-rw-r--r--ale_linters/javascript/standard.vim2
-rw-r--r--ale_linters/javascript/xo.vim2
-rw-r--r--ale_linters/kotlin/kotlinc.vim4
-rw-r--r--ale_linters/lua/luacheck.vim2
-rw-r--r--ale_linters/nim/nimcheck.vim2
-rw-r--r--ale_linters/python/flake8.vim4
-rw-r--r--ale_linters/python/mypy.vim2
-rw-r--r--ale_linters/python/pylint.vim2
-rw-r--r--ale_linters/tex/chktex.vim2
-rw-r--r--ale_linters/typescript/tslint.vim2
-rw-r--r--ale_linters/verilog/verilator.vim2
25 files changed, 31 insertions, 32 deletions
diff --git a/ale_linters/asm/gcc.vim b/ale_linters/asm/gcc.vim
index 4288f5de..1ff348d8 100644
--- a/ale_linters/asm/gcc.vim
+++ b/ale_linters/asm/gcc.vim
@@ -5,7 +5,7 @@ let g:ale_asm_gcc_options = get(g:, 'ale_asm_gcc_options', '-Wall')
function! ale_linters#asm#gcc#GetCommand(buffer) abort
return 'gcc -x assembler -fsyntax-only '
- \ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
+ \ . '-iquote ' . shellescape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ' ' . ale#Var(a:buffer, 'asm_gcc_options') . ' -'
endfunction
diff --git a/ale_linters/c/clang.vim b/ale_linters/c/clang.vim
index 38e0d480..8a5c84c2 100644
--- a/ale_linters/c/clang.vim
+++ b/ale_linters/c/clang.vim
@@ -13,7 +13,7 @@ function! ale_linters#c#clang#GetCommand(buffer) abort
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
return 'clang -S -x c -fsyntax-only '
- \ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
+ \ . '-iquote ' . shellescape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ' ' . ale#Var(a:buffer, 'c_clang_options') . ' -'
endfunction
diff --git a/ale_linters/c/gcc.vim b/ale_linters/c/gcc.vim
index 7eed0f45..b783a7d7 100644
--- a/ale_linters/c/gcc.vim
+++ b/ale_linters/c/gcc.vim
@@ -13,7 +13,7 @@ function! ale_linters#c#gcc#GetCommand(buffer) abort
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
return 'gcc -S -x c -fsyntax-only '
- \ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
+ \ . '-iquote ' . shellescape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ' ' . ale#Var(a:buffer, 'c_gcc_options') . ' -'
endfunction
diff --git a/ale_linters/cpp/clang.vim b/ale_linters/cpp/clang.vim
index b830f6a7..bd4d26ef 100644
--- a/ale_linters/cpp/clang.vim
+++ b/ale_linters/cpp/clang.vim
@@ -10,7 +10,7 @@ function! ale_linters#cpp#clang#GetCommand(buffer) abort
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
return 'clang++ -S -x c++ -fsyntax-only '
- \ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
+ \ . '-iquote ' . shellescape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ' ' . ale#Var(a:buffer, 'cpp_clang_options') . ' -'
endfunction
diff --git a/ale_linters/cpp/gcc.vim b/ale_linters/cpp/gcc.vim
index 19de0c9c..981caec0 100644
--- a/ale_linters/cpp/gcc.vim
+++ b/ale_linters/cpp/gcc.vim
@@ -20,7 +20,7 @@ function! ale_linters#cpp#gcc#GetCommand(buffer) abort
" -iquote with the directory the file is in makes #include work for
" headers in the same directory.
return 'gcc -S -x c++ -fsyntax-only '
- \ . '-iquote ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
+ \ . '-iquote ' . shellescape(fnamemodify(bufname(a:buffer), ':p:h'))
\ . ' ' . ale#Var(a:buffer, 'cpp_gcc_options') . ' -'
endfunction
diff --git a/ale_linters/css/csslint.vim b/ale_linters/css/csslint.vim
index fb262497..83698f54 100644
--- a/ale_linters/css/csslint.vim
+++ b/ale_linters/css/csslint.vim
@@ -4,7 +4,7 @@
function! ale_linters#css#csslint#GetCommand(buffer) abort
let l:csslintrc = ale#path#FindNearestFile(a:buffer, '.csslintrc')
let l:config_option = !empty(l:csslintrc)
- \ ? '--config=' . fnameescape(l:csslintrc)
+ \ ? '--config=' . shellescape(l:csslintrc)
\ : ''
return 'csslint --format=compact ' . l:config_option . ' %t'
diff --git a/ale_linters/d/dmd.vim b/ale_linters/d/dmd.vim
index 3805e024..7068681b 100644
--- a/ale_linters/d/dmd.vim
+++ b/ale_linters/d/dmd.vim
@@ -31,7 +31,7 @@ function! ale_linters#d#dmd#DUBCommand(buffer) abort
" To support older dub versions, we just change the directory to
" the directory where we found the dub config, and then run `dub describe`
" from that directory.
- return 'cd ' . fnameescape(fnamemodify(l:dub_file, ':h'))
+ return 'cd ' . shellescape(fnamemodify(l:dub_file, ':h'))
\ . ' && dub describe --import-paths'
endfunction
@@ -42,7 +42,7 @@ function! ale_linters#d#dmd#DMDCommand(buffer, dub_output) abort
for l:line in a:dub_output
if !empty(l:line)
" The arguments must be '-Ifilename', not '-I filename'
- call add(l:import_list, '-I' . fnameescape(l:line))
+ call add(l:import_list, '-I' . shellescape(l:line))
endif
endfor
diff --git a/ale_linters/elm/make.vim b/ale_linters/elm/make.vim
index 32f824e0..75a124ae 100644
--- a/ale_linters/elm/make.vim
+++ b/ale_linters/elm/make.vim
@@ -43,7 +43,7 @@ function! ale_linters#elm#make#GetCommand(buffer) abort
let l:dir_set_cmd = ''
else
let l:root_dir = fnamemodify(l:elm_package, ':p:h')
- let l:dir_set_cmd = 'cd ' . fnameescape(l:root_dir) . ' && '
+ let l:dir_set_cmd = 'cd ' . shellescape(l:root_dir) . ' && '
endif
" The elm-make compiler, at the time of this writing, uses '/dev/null' as
diff --git a/ale_linters/erlang/erlc.vim b/ale_linters/erlang/erlc.vim
index a44e9887..1b0f16cc 100644
--- a/ale_linters/erlang/erlc.vim
+++ b/ale_linters/erlang/erlc.vim
@@ -6,7 +6,7 @@ function! ale_linters#erlang#erlc#GetCommand(buffer) abort
let l:output_file = tempname()
call ale#engine#ManageFile(a:buffer, l:output_file)
- return 'erlc -o ' . fnameescape(l:output_file)
+ return 'erlc -o ' . shellescape(l:output_file)
\ . ' ' . ale#Var(a:buffer, 'erlang_erlc_options')
\ . ' %t'
endfunction
diff --git a/ale_linters/go/gometalinter.vim b/ale_linters/go/gometalinter.vim
index 6ad78cab..9913f21a 100644
--- a/ale_linters/go/gometalinter.vim
+++ b/ale_linters/go/gometalinter.vim
@@ -8,7 +8,7 @@ endif
function! ale_linters#go#gometalinter#GetCommand(buffer) abort
return 'gometalinter '
\ . ale#Var(a:buffer, 'go_gometalinter_options')
- \ . ' ' . fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
+ \ . ' ' . shellescape(fnamemodify(bufname(a:buffer), ':p:h'))
endfunction
function! ale_linters#go#gometalinter#GetMatches(lines) abort
diff --git a/ale_linters/java/javac.vim b/ale_linters/java/javac.vim
index 5a109997..2966d069 100644
--- a/ale_linters/java/javac.vim
+++ b/ale_linters/java/javac.vim
@@ -41,14 +41,13 @@ endfunction
function! s:BuildClassPathOption(buffer, import_paths) abort
" Filter out lines like [INFO], etc.
let l:class_paths = filter(a:import_paths[:], 'v:val !~# ''[''')
- call map(l:class_paths, 'fnameescape(v:val)')
call extend(
\ l:class_paths,
\ split(ale#Var(a:buffer, 'java_javac_classpath'), s:classpath_sep),
\)
return !empty(l:class_paths)
- \ ? '-cp ' . join(l:class_paths, s:classpath_sep)
+ \ ? '-cp ' . shellescape(join(l:class_paths, s:classpath_sep))
\ : ''
endfunction
@@ -65,7 +64,7 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
let l:src_dir = ale#path#FindNearestDirectory(a:buffer, 'src/main/java')
if !empty(l:src_dir)
- let l:sp_option = '-sourcepath ' . fnameescape(l:src_dir)
+ let l:sp_option = '-sourcepath ' . shellescape(l:src_dir)
endif
" Create .class files in a temporary directory, which we will delete later.
@@ -74,7 +73,7 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort
return 'javac -Xlint'
\ . ' ' . l:cp_option
\ . ' ' . l:sp_option
- \ . ' -d ' . fnameescape(l:class_file_directory)
+ \ . ' -d ' . shellescape(l:class_file_directory)
\ . ' ' . ale#Var(a:buffer, 'java_javac_options')
\ . ' %t'
endfunction
diff --git a/ale_linters/javascript/eslint.vim b/ale_linters/javascript/eslint.vim
index 67b65839..7e4929b4 100644
--- a/ale_linters/javascript/eslint.vim
+++ b/ale_linters/javascript/eslint.vim
@@ -34,7 +34,7 @@ function! ale_linters#javascript#eslint#GetExecutable(buffer) abort
endfunction
function! ale_linters#javascript#eslint#GetCommand(buffer) abort
- return fnameescape(ale_linters#javascript#eslint#GetExecutable(a:buffer))
+ return shellescape(ale_linters#javascript#eslint#GetExecutable(a:buffer))
\ . ' ' . ale#Var(a:buffer, 'javascript_eslint_options')
\ . ' -f unix --stdin --stdin-filename %s'
endfunction
diff --git a/ale_linters/javascript/flow.vim b/ale_linters/javascript/flow.vim
index 14f65126..36247cd1 100644
--- a/ale_linters/javascript/flow.vim
+++ b/ale_linters/javascript/flow.vim
@@ -27,7 +27,7 @@ function! ale_linters#javascript#flow#GetCommand(buffer) abort
return ''
endif
- return fnameescape(ale_linters#javascript#flow#GetExecutable(a:buffer))
+ return shellescape(ale_linters#javascript#flow#GetExecutable(a:buffer))
\ . ' check-contents --respect-pragma --json --from ale %s'
endfunction
diff --git a/ale_linters/javascript/jshint.vim b/ale_linters/javascript/jshint.vim
index 657b0ff5..ec3c2c95 100644
--- a/ale_linters/javascript/jshint.vim
+++ b/ale_linters/javascript/jshint.vim
@@ -27,11 +27,11 @@ function! ale_linters#javascript#jshint#GetCommand(buffer) abort
\ get(g:, 'ale_jshint_config_loc', '')
\)
- let l:command = fnameescape(ale_linters#javascript#jshint#GetExecutable(a:buffer))
+ let l:command = shellescape(ale_linters#javascript#jshint#GetExecutable(a:buffer))
let l:command .= ' --reporter unix --extract auto'
if !empty(l:jshint_config)
- let l:command .= ' --config ' . fnameescape(l:jshint_config)
+ let l:command .= ' --config ' . shellescape(l:jshint_config)
endif
let l:command .= ' -'
diff --git a/ale_linters/javascript/standard.vim b/ale_linters/javascript/standard.vim
index 1b82823c..30ebae10 100644
--- a/ale_linters/javascript/standard.vim
+++ b/ale_linters/javascript/standard.vim
@@ -23,7 +23,7 @@ function! ale_linters#javascript#standard#GetExecutable(buffer) abort
endfunction
function! ale_linters#javascript#standard#GetCommand(buffer) abort
- return fnameescape(ale_linters#javascript#standard#GetExecutable(a:buffer))
+ return shellescape(ale_linters#javascript#standard#GetExecutable(a:buffer))
\ . ' ' . ale#Var(a:buffer, 'javascript_standard_options')
\ . ' --stdin %s'
endfunction
diff --git a/ale_linters/javascript/xo.vim b/ale_linters/javascript/xo.vim
index a3e9f999..b7a549f0 100644
--- a/ale_linters/javascript/xo.vim
+++ b/ale_linters/javascript/xo.vim
@@ -23,7 +23,7 @@ function! ale_linters#javascript#xo#GetExecutable(buffer) abort
endfunction
function! ale_linters#javascript#xo#GetCommand(buffer) abort
- return fnameescape(ale_linters#javascript#xo#GetExecutable(a:buffer))
+ return shellescape(ale_linters#javascript#xo#GetExecutable(a:buffer))
\ . ' ' . ale#Var(a:buffer, 'javascript_xo_options')
\ . ' --reporter unix --stdin --stdin-filename %s'
endfunction
diff --git a/ale_linters/kotlin/kotlinc.vim b/ale_linters/kotlin/kotlinc.vim
index 0ada361f..543c3a99 100644
--- a/ale_linters/kotlin/kotlinc.vim
+++ b/ale_linters/kotlin/kotlinc.vim
@@ -16,13 +16,13 @@ function! ale_linters#kotlin#kotlinc#GetCommand(buffer) abort
" If the config file is enabled and readable, source it
if ale#Var(a:buffer, 'kotlin_kotlinc_enable_config')
if filereadable(expand(ale#Var(a:buffer, 'kotlin_kotlinc_config_file'), 1))
- execute 'source ' . fnameescape(expand(ale#Var(a:buffer, 'kotlin_kotlinc_config_file'), 1))
+ execute 'source ' . shellescape(expand(ale#Var(a:buffer, 'kotlin_kotlinc_config_file'), 1))
endif
endif
" If use module and module file is readable use that and return
if ale#Var(a:buffer, 'kotlin_kotlinc_use_module_file')
- let l:module_filename = fnameescape(expand(ale#Var(a:buffer, 'kotlin_kotlinc_module_filename'), 1))
+ let l:module_filename = shellescape(expand(ale#Var(a:buffer, 'kotlin_kotlinc_module_filename'), 1))
if filereadable(l:module_filename)
let l:kotlinc_opts .= ' -module ' . l:module_filename
diff --git a/ale_linters/lua/luacheck.vim b/ale_linters/lua/luacheck.vim
index 0098e66e..8e3e9869 100644
--- a/ale_linters/lua/luacheck.vim
+++ b/ale_linters/lua/luacheck.vim
@@ -12,7 +12,7 @@ function! ale_linters#lua#luacheck#GetExecutable(buffer) abort
endfunction
function! ale_linters#lua#luacheck#GetCommand(buffer) abort
- return ale_linters#lua#luacheck#GetExecutable(a:buffer)
+ return shellescape(ale_linters#lua#luacheck#GetExecutable(a:buffer))
\ . ' ' . ale#Var(a:buffer, 'lua_luacheck_options')
\ . ' --formatter plain --codes --filename %s -'
endfunction
diff --git a/ale_linters/nim/nimcheck.vim b/ale_linters/nim/nimcheck.vim
index 02a7c931..9bd19720 100644
--- a/ale_linters/nim/nimcheck.vim
+++ b/ale_linters/nim/nimcheck.vim
@@ -44,7 +44,7 @@ endfunction
function! ale_linters#nim#nimcheck#GetCommand(buffer) abort
- let l:directory = fnameescape(fnamemodify(bufname(a:buffer), ':p:h'))
+ let l:directory = shellescape(fnamemodify(bufname(a:buffer), ':p:h'))
return 'nim check --path:' . l:directory
\ . ' --threads:on --verbosity:0 --colors:off --listFullPaths %t'
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index 4959583f..99e93725 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -48,7 +48,7 @@ function! ale_linters#python#flake8#VersionCheck(buffer) abort
return ''
endif
- let l:executable = fnameescape(ale_linters#python#flake8#GetExecutable(a:buffer))
+ let l:executable = shellescape(ale_linters#python#flake8#GetExecutable(a:buffer))
let l:module_string = s:UsingModule(a:buffer) ? ' -m flake8' : ''
return l:executable . l:module_string . ' --version'
@@ -89,7 +89,7 @@ function! ale_linters#python#flake8#GetCommand(buffer, version_output) abort
let l:options = ale#Var(a:buffer, 'python_flake8_options')
- return fnameescape(ale_linters#python#flake8#GetExecutable(a:buffer))
+ return shellescape(ale_linters#python#flake8#GetExecutable(a:buffer))
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . l:display_name_args . ' -'
endfunction
diff --git a/ale_linters/python/mypy.vim b/ale_linters/python/mypy.vim
index 135084da..7275af39 100644
--- a/ale_linters/python/mypy.vim
+++ b/ale_linters/python/mypy.vim
@@ -30,7 +30,7 @@ function! ale_linters#python#mypy#GetCommand(buffer) abort
let l:executable = ale_linters#python#mypy#GetExecutable(a:buffer)
return l:cd_command
- \ . fnameescape(l:executable)
+ \ . shellescape(l:executable)
\ . ' --show-column-numbers '
\ . ale#Var(a:buffer, 'python_mypy_options')
\ . ' %s'
diff --git a/ale_linters/python/pylint.vim b/ale_linters/python/pylint.vim
index b2cc07f3..cce28479 100644
--- a/ale_linters/python/pylint.vim
+++ b/ale_linters/python/pylint.vim
@@ -26,7 +26,7 @@ function! ale_linters#python#pylint#GetExecutable(buffer) abort
endfunction
function! ale_linters#python#pylint#GetCommand(buffer) abort
- return fnameescape(ale_linters#python#pylint#GetExecutable(a:buffer))
+ return shellescape(ale_linters#python#pylint#GetExecutable(a:buffer))
\ . ' ' . ale#Var(a:buffer, 'python_pylint_options')
\ . ' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n'
\ . ' %s'
diff --git a/ale_linters/tex/chktex.vim b/ale_linters/tex/chktex.vim
index c65deede..776974ab 100644
--- a/ale_linters/tex/chktex.vim
+++ b/ale_linters/tex/chktex.vim
@@ -18,7 +18,7 @@ function! ale_linters#tex#chktex#GetCommand(buffer) abort
let l:command .= ' -v0 -p stdin -q'
if !empty(l:chktex_config)
- let l:command .= ' -l ' . fnameescape(l:chktex_config)
+ let l:command .= ' -l ' . shellescape(l:chktex_config)
endif
let l:command .= ' ' . ale#Var(a:buffer, 'tex_chktex_options')
diff --git a/ale_linters/typescript/tslint.vim b/ale_linters/typescript/tslint.vim
index c56c8b23..8ba99cc4 100644
--- a/ale_linters/typescript/tslint.vim
+++ b/ale_linters/typescript/tslint.vim
@@ -55,7 +55,7 @@ function! ale_linters#typescript#tslint#BuildLintCommand(buffer) abort
\)
let l:tslint_config_option = !empty(l:tslint_config_path)
- \ ? '-c ' . fnameescape(l:tslint_config_path)
+ \ ? '-c ' . shellescape(l:tslint_config_path)
\ : ''
return ale_linters#typescript#tslint#GetExecutable(a:buffer)
diff --git a/ale_linters/verilog/verilator.vim b/ale_linters/verilog/verilator.vim
index e2dbafac..ed26c1f2 100644
--- a/ale_linters/verilog/verilator.vim
+++ b/ale_linters/verilog/verilator.vim
@@ -8,7 +8,7 @@ function! ale_linters#verilog#verilator#GetCommand(buffer) abort
call ale#engine#ManageFile(a:buffer, l:filename)
call writefile(getbufline(a:buffer, 1, '$'), l:filename)
- return 'verilator --lint-only -Wall -Wno-DECLFILENAME ' . fnameescape(l:filename)
+ return 'verilator --lint-only -Wall -Wno-DECLFILENAME ' . shellescape(l:filename)
endfunction
function! ale_linters#verilog#verilator#Handle(buffer, lines) abort