-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix #14116 (cmdline: Improve IDE integration with --file-filter=+ option) #7799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@firewave I am particularly interested in feedback from you. :-) We want that customers are able to reuse the same foo.cppcheck file or whatever both on the command line and in the IDE. We don't want that each developer manually has to configure various IDE plugin options. |
This is essentially #6754 with an added CLI option. I prefer the previous version as it is cleaner. |
And this needs Python tests which actually test this behavior. |
I don't have a strong opinion. both |
With |
I implemented it that way so an existing With And the |
Imho the problem is that it's very often |
Imho the existing |
|
That depends on the IDE implementation. In CLion the project location is not available so it can only provide the filename. I know other IDE integrations provide the project and people assumed that by adding the filename they could filter it. But what would have happened in that case that it was analyzing all of the project and the specified file. Me disallowing a project and individual files being used flushed out such a case in the forum (no link handy). How this was actually usable in terms of performance is baffling. Thinking a bit... it could have been the other way around that it was just the file and people thought adding I think this is the most flexible and clear approach (pending feedback). I will give it a spin in CLion tomorrow. |
I do not understand this really. so as I understand it, the clion plugin checks a temporary file.. ?
thanks!! |
Yes. That is done because CLion has a virtual filesystem and the changes might not have been applied to the actual filesystem yet. This way it is ensured it is using the current content. It also avoid the file being changed while it is being read for the analysis. IIRC there would access issues in the past without doing this. I am not sure that is the proper way to do it but it works fine.
That is not necessary because in the IDE you only change one file at a time and that is the only file you want to analyze for.
The new approach does not work with CLion because of the temporary file:
To get that to work you would require some mapping. The failing command is And it would need to be something like (this the first thing I could think of)
But I have the feeling that it could get quite messy and I would not even try to prototype that until #6379 has been merged. |
I understand. I am not sure I like this but I do not have better suggestions directly :-(
me too.. I fear this got quite complex.. I suggest that we leave that for later. And merge this PR as is. |
It's not 100% true. If you check C++ code and then only have the .cpp file but not the header it is likely that the checking will be very limited because the function scopes are not created properly without the declarations.. Example code:
|
I am very late about this. but I will talk about cppcheck integration at the cppcon in less than 2 weeks. And it would be nice to have some option that allows |
That's fine with me. The additional is perfectly fine and a nice enhancement. I will file a ticket with the CLion case and look into it when the interfaces have been cleaned up (still a couple of PRs which need to go in first). |
Maybe |
No description provided.