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

Added clang-tidy for C, too. #827

Merged
merged 3 commits into from Aug 30, 2017
Merged

Added clang-tidy for C, too. #827

merged 3 commits into from Aug 30, 2017

Conversation

randrej
Copy link
Contributor

@randrej randrej commented Aug 5, 2017

A limited number of clang-tidy checks can be used with C, too. I pretty much
copied and refactored the C++ clang-tidy linter, and added some documentation
about C-compatible checks.

A limited number of clang-tidy checks can be used with C, too. I pretty much
copied and refactored the C++ clang-tidy linter, and added some documentation
about C-compatible checks.
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.

See my comments here, and cover the new functions with Vader tests.

" C++
"
" Here is an incomplete list of C-compatible checks for clang-tidy version 6:
" bugprone-suspicious-memset-usage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an awfully large comment, here and below. Could you replace this with a link to the clang-tidy documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I put the list here because the documentation only lists all of the checks, without any indication if they work for C, or just C++. I actually went through all of them by hand and picked out those that work for C.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.
70cd1d5

doc/ale-c.txt Outdated
readability-simplify-boolean-expr


g:ale_c_clangtidy_executable *g:ale_c_clangtidy_executable*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub makes it look like the helptag isn't aligned to the right margin. Make sure they all are. There's an ALEFix function for aligning help tags to the right margin you can use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Should I flatten the commits into one after I fix everything?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, I actually prefer having many commits for pull requests, so I can see the difference before and after reviews. Then I just squash the pull request into one commit after that via GitHub's button for --ff --squash.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.
e4a6da9

@w0rp
Copy link
Member

w0rp commented Aug 6, 2017

Cool, now you can add some Vader tests.

@w0rp w0rp merged commit e4a6da9 into dense-analysis:master Aug 30, 2017
@w0rp
Copy link
Member

w0rp commented Aug 30, 2017

I added a Vader test for this by copying the C++ one, and I linked the C++ documentation for the build directory options to the C file.

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