Can the <str> value for --file-filter include multiple file types? For example: ".c;.cpp". I am working on a precommit script and would like to filter the files that cppcheck will scan. The script gets as an argument all the files that are to be committed and may include files that cppcheck should not scan (.h, .txt, etc)</str>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
but hmm .. as far as I remember the --file-filter is only used when you have a project file. that would not normally build txt/h/etc files. how do you pass the files to check to cppcheck?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for that suggestion. That will work for us for the time being though in the long term if there are files with differing extensions that we would like to check we might need to think about it a little more. Seems like allowing multiple extensions in the <str> argument would be a nice update.</str>
We are using TortoiseGit and it provides a file with a list of files that are to be committed as an input argument to the script. We are not using a project file. Command line used in the .bat file is:
Thanks for that suggestion. That will work for us for the time being though in the long term if there are files with differing extensions that we would like to check we might need to think about it a little more. Seems like allowing multiple extensions in the <str> argument would be a nice update.</str>
We are using TortoiseGit and it provides a file with a list of files that are to be committed as an input argument to the script. We are not using a project file. Command line used in the .bat file is:
Can the <str> value for --file-filter include multiple file types? For example: ".c;.cpp". I am working on a precommit script and would like to filter the files that cppcheck will scan. The script gets as an argument all the files that are to be committed and may include files that cppcheck should not scan (.h, .txt, etc)</str>
not currently. but *
.c*
might be acceptable?but hmm .. as far as I remember the --file-filter is only used when you have a project file. that would not normally build txt/h/etc files. how do you pass the files to check to cppcheck?
Thanks for that suggestion. That will work for us for the time being though in the long term if there are files with differing extensions that we would like to check we might need to think about it a little more. Seems like allowing multiple extensions in the <str> argument would be a nice update.</str>
We are using TortoiseGit and it provides a file with a list of files that are to be committed as an input argument to the script. We are not using a project file. Command line used in the .bat file is:
cppcheck.exe --error-exitcode=1 --file-list=%1 --file-filter=.c %OPT% > cpp.log 2>&1
%OPT% is the list of suppressions to use during evaluation.
Thanks for that suggestion. That will work for us for the time being though in the long term if there are files with differing extensions that we would like to check we might need to think about it a little more. Seems like allowing multiple extensions in the <str> argument would be a nice update.</str>
We are using TortoiseGit and it provides a file with a list of files that are to be committed as an input argument to the script. We are not using a project file. Command line used in the .bat file is:
cppcheck.exe --error-exitcode=1 --file-list=%1 --file-filter=.c %OPT% > cpp.log 2>&1
%OPT% is the list of suppressions to use during evaluation.