Author Topic: customize cppcheckInput.txt folders cppcheck uses  (Read 6551 times)

Offline proton

  • Single posting newcomer
  • *
  • Posts: 2
customize cppcheckInput.txt folders cppcheck uses
« on: December 10, 2021, 04:43:00 pm »
Hello,
I like the cppcheck plugin to look only at two folders of my codeblocks project. Can I customize the cppcheckinput.txt to say which folder it covers?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1628
Re: customize cppcheckInput.txt folders cppcheck uses
« Reply #1 on: December 10, 2021, 05:59:00 pm »
Currently not, the file is created on the fly and contains all the files in the project identified as headers or sources (C and C++).

OTOH you can exclude dirs using --config-exclude=<dir> or files, see cppcheck documentation.

Offline proton

  • Single posting newcomer
  • *
  • Posts: 2
Re: customize cppcheckInput.txt folders cppcheck uses
« Reply #2 on: December 10, 2021, 10:51:00 pm »
Hello Miguel  :),

I could not make it work. 
I am using Windows.

I made a C test program with main.c, /foodir/foo.h /foodir.c

In C::B, I put this in environment settings->cppcheck->cppcheck arguments:
Quote
--verbose --enable=all --enable=style --xml --suppress=missingIncludeSystem --config-exclude=foodir


After clicking on the plugins ->cppcheck, I see in the bottom of codeblocks:
Quote
cppcheck.exe --verbose --enable=all --enable=style --xml --suppress=missingIncludeSystem --config-exclude=/foodir --file-list=CppCheckInput.txt -I"foodir"

It looks like C::B put back the foodir with the -I.

Is there another way to change what is run at the command line?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1628
Re: customize cppcheckInput.txt folders cppcheck uses
« Reply #3 on: December 11, 2021, 02:10:33 pm »
You can check
Code
--config-exclude=foodir
(without the /), but I don't know if cppcheck will priorize --config-exclude or -I

Quote
Is there another way to change what is run at the command line?

Not without editing the plugin code.