-
Notifications
You must be signed in to change notification settings - Fork 144
build: Add clang-tidy checks and script #1807
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
build: Add clang-tidy checks and script #1807
Conversation
|
Out of interest, why does this close the clang-format stuff? Clang-tidy and clang-format perform different functions as I understand it. |
I was in the understanding the three closed PR's were replacable by this work - additionally they were also not worked on, I'm doing a clean up of older PR's. But if I was mistaken, please open the other PR again (and remove it from the first-post here). |
0ad4d79 to
2caeed2
Compare
|
This works for me on mac and windows: EDIT while it runs on mac, it lacks a lot of Windows specific stuff and will skip a ton of files. I've removed mac support from the script and docs. Use Windows |
07d1ba4 to
fe57955
Compare
fe57955 to
951288d
Compare
OmniBlade
left a comment
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.
In my testing it seems that a required cmake argument is missing from the command suggested by the help text.
|
A general comment I have is while this does work, it does the file checking serially and could work much faster on multi core machines if it generated multiple clang-tidy processes. I've not worked with clang-tidy that much previously so I'm not sure how easy that is to accomplish. |
Yeah I noticed this too - The script already supports parallelization via --jobs. It defaults to --jobs 1 (serial). Updating it to default to the number of CPU cores: |
…arallelization by default
OmniBlade
left a comment
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.
I think that has addressed any issues I had. Only issue with running the script is that currently running it on anything more than a handful of files generates a lot of output to pour over.
…errors by default
This PR builds on @JohnsterID's work in PR #1580, fixing issues identified in that PR to enable clang-tidy static analysis for the project.
Clang-tidy doesnot work with our Pre-Compiled Headers, so we can just run cmake to disable them, then it works. Added a python script for convenience and for processing files in batches to avoid Windows command line character limits.
Usage: