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
Add clangcheck Linter to cpp #686
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…angtidy-build_option
It allows looking for specific names in the project tree. Setting a default value for this option means clang-tidy should work out of the box for most "out-of-source build" projects. Overriding either this value or the builddir option allows to finely control the expected location of compile_commands.json
Since the build folder is found upwards from current directory the returned path for the linter is absolute, and it needs to be adjusted to follow Travis architecture.
The goal is to use the same variables for all C-family linters
It implies using the new autoload/ale/c.vim file, and cleaning up variable names to be less linter-specific and more language-specific
Calling only ale#Var is bad, since we need to look at least once in ale#c autoload file in order to load the relevant global variable
Removed the trailing /, as it is taken into account in ale#c#FindCompileCommands by looking for `/compile_commands.json` in each candidate folder
…clangtidy_options
w0rp
approved these changes
Jun 24, 2017
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.
Yep, looks good. Thank you for all of your work on this. 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to #392 but does not fix it.
In order to run clang static analysis that actually finds headers in not obvious places, I added the clang-check linter to the list of cpp linters. As stated by the doc, clang-check is a wrapper of libTooling to run those static analyses. That means it supports reading compilation databases JSONs and I think we should be able to use this tool when possible (especially since clang-tidy is not packaged in Fedora, so clang-check is the easiest method of running clang analysis on cpp code in my opinion).
I am not really proficient with Vader yet, so there are no tests for the time being, but it's the only missing part to be perfectly, fully compliant with merge guidelines. Hopefully it won't take too long to do, as it is heavily inspired on clang-tidy linter