Skip to content
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 34 commits into from Jun 24, 2017
Merged

Add clangcheck Linter to cpp #686

merged 34 commits into from Jun 24, 2017

Conversation

gagbo
Copy link
Contributor

@gagbo gagbo commented Jun 23, 2017

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

gagbo added 28 commits June 23, 2017 12:17
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
@gagbo
Copy link
Contributor Author

gagbo commented Jun 24, 2017

Commit 622584c is related to #688 actually, but I forgot to precise the weird interactions between options in clang-tidy linter

Copy link
Member

@w0rp w0rp left a 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. 👍

@w0rp w0rp merged commit dc647fc into dense-analysis:master Jun 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants