cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

added (undocumented) `--no-cppcheck-build-dir` command-line option to clear previously specified build-dir

Open firewave opened this issue 1 year ago • 1 comments

firewave avatar Oct 21 '24 18:10 firewave

Extracted from #6876.

firewave avatar Oct 21 '24 18:10 firewave

what is the use case. can't you just remove the previously specified build-dir.

danmar avatar Oct 26 '24 18:10 danmar

what is the use case. can't you just remove the previously specified build-dir.

The point is to indicate that we do not want a build-dir in any case. Otherwise #6876 will inject it into the tests. Since that is the main reason to add it, it is undocumented for now. I also noted this in a comment in the code.

It would also allow someone to override it in case you have fixed (immutable) options like in a IDE or CI integration to test/workaround things (IMO it should be possible for any option to be overridden).

firewave avatar Oct 26 '24 18:10 firewave

I don't see how the flag will be used in the pytest files. can't we do something in the pytest instead?

also I think the behavior should be the same locally and in the CI. so if I run python3 -m pytest sometest.py locally and a test does not use a cppcheck build dir then in the CI there should not be a cppcheck build dir neither.

danmar avatar Oct 27 '24 19:10 danmar

I don't see how the flag will be used in the pytest files.

That was all stated in ma previous comment.

can't we do something in the pytest instead?

That would require a rework of all the test classes and I am not sure if we will get the desired behavior or if it would actually work. This approach is very unintrusive and it "just works" - and we have been using it for quite a while now.

firewave avatar Oct 28 '24 02:10 firewave

No further feedback in over a month - merging.

firewave avatar Dec 02 '24 05:12 firewave