-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 a clang-tidy config file #1434
Conversation
I think it is best to introduce things like this along with the CI script to run/check it. |
And I agree - a very good starting point. |
Agreed. But I don't know anything about github CI, hopefully someone else can integrate this. At least this file allows developers to use clang-tidy locally.
Correct; as far as I know. |
All checks are enabled except for those that cause any warning. This is a starting point, some of the currently-supressed warnings can be fixed hereafter.
Do we want to take this one step further and add clang-format as a prerequisite? |
Did you mean clang-tidy? clang-format is an orthogonal discussion. I had started work on clang-format, but waiting reply here: #1421 (comment) |
I mean both. I kind of want to set minimum standards on commits. |
I'm all for clang-format too. But it's unrelated to clang-tidy and this PR. Let's move the discussion here: #1442 |
@tormodvolden for example, if this was merged to master, then I (and others) could be using clang-tidy to check our work in other branches. |
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.
@tormodvolden @hjelmn is there any reason to not just merge this? It can't break anything else, it's just a config file... |
Can you please give some quick instructions how to use it? I installed clang-tidy (and half a gigabyte of dependencies) and naively tried "clang-tidy" or "clang-tidy <list of .c and .h files>" but I got a load of warnings, and some hinting about a database. |
It's referring to a 'compilation database'. I used the cmake fork of libusb to generate one. Thanks for merging! |
All checks are enabled except for those that cause any warning.
This is a starting point, some of the currently-supressed warnings can be fixed hereafter.