-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
WIP: Add cppcheck includes when modified buffer or no compile_commands.json #2506
Conversation
If a file is modified, using compile_commands.json doesn't work, because it doesn't take into account the local changes. Instead, include the file's directory in the cppcheck call with -I. Also do this if compile_commands.json isn't found. This could be expanded to add other -I flags to cppcheck based on the command in compile_commands.json, if found.
You can use Is there any danger in always setting |
I'm not sure it'd make a difference. I think cppcheck just ignores -I when --project is given. |
Actually, after setting modified, do I need to call ALE again? I've tried
and
but neither seem to work. I'd appreciate the help, if you want that last test. I don't have time to pursue this much further. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The duplicate code can be written in one function here. If you can get the tests to work, let me know. If not, I or someone else might pick this up later.
I escaped the paths. Can you clarify what you think should be a separate function, and where it should live? |
You can create a function in |
Alright, refactored, and all but that one test (where I |
@bartlibert Does this look okay to you? |
Looks fine to me. Nice improvement. |
I fixed the test and merged this via the commandline now. |
This can probably be expanded to look at -I directives from compile_commands.json to make it more robust. See comments in the code.
I don't know how to modify a buffer from a Vader Execute block, so those tests are failing right now. You may have a better idea.