mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 10:57:30 +08:00
lint.fish: properly handle -I and -D args for cppcheck
lint.fish receives arguments that contain multiple includes and defines. As a result, we passed arguments like "-I/usr/include -I$HOME/fish-shell/build -I/usr/include" to cppcheck which interprets this as a single include directory. This leads to errors like this one (because the "build" dir was missing): src/common.h:4:0: information: Include file: "config.h" not found. [missingInclude]
This commit is contained in:
parent
f0f5724e18
commit
a205225b4e
|
@ -18,11 +18,11 @@ argparse a/all p/project= -- $argv
|
|||
# We only want -D and -I options to be passed thru to cppcheck.
|
||||
for arg in $argv
|
||||
if string match -q -- '-D*' $arg
|
||||
set cppcheck_args $cppcheck_args $arg
|
||||
set -a cppcheck_args (string split -- ' ' $arg)
|
||||
else if string match -q -- '-I*' $arg
|
||||
set cppcheck_args $cppcheck_args $arg
|
||||
set -a cppcheck_args (string split -- ' ' $arg)
|
||||
else if string match -q -- '-iquote*' $arg
|
||||
set cppcheck_args $cppcheck_args $arg
|
||||
set -a cppcheck_args (string split -- ' ' $arg)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user