-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Shift clang-tidy
to github action
#28566
Comments
clang-tidy is currently disabled pending resolution here |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions. |
can we prioritize this? I genuinely think this is really bad for the long term as it directly affects the code quality plus security risk |
its half complete - atm you can run: ./ci/do_ci.sh clang-tidy and it kinda works the reason i didnt land in ci is that it is not 100% - i took someone elses (aspect-based) clang-tidy implementation and hacked a few things to make it work to my expectations i havent had too much time to do it recently - but in the past i ran it and fixed any issues - probably that would be a good place to start - the tool could do with some non-me testing and feedback |
so yeah one thing I noticed is
can we exclude external? |
I think that would save tons of CPU times in CI |
good q - i never really got to the bottom of this i think it does exclude it to the extent that it doesnt throw errors - at least using the do_ci.sh way - but i have always been convinced that its checking a lot more than it should |
meanwhile I will fix the errors and warning emitted currently little by little |
also noticed that
|
Also noticed that clang-tidy runs multiple times each time included == if a file That's the reason why it's running on edited: maybe the find-and-run style won't work if the file include the thirparty stuff... maybe I am missing something though |
I found the root cause of why it's running multiple times on the same file:
the newly introduced toolshed clang-tidy runs clang-tidy on each file but our .clang-tidy.yaml tells it to emit warning for all envoy repo headers. We definitely should invoke clang-tidy once, not on each file... |
can we revert #29848 and bring the compilation_db+manual clang-tidy invocation back? I think that's much simpiler |
basically using aspect (i assume that runs on each build target) for clang-tidy seems not the right way |
no!!! really lets not - that way was awful and the general advice is to shift to aspects for this kind of job what is the issue you are having? bazel certainly adds some overhead but it has its uses also |
the point about using aspects - iiuc - is that you dont need to compile everything to run it |
ok, the issue is it's running clang-tidy on each header/source files hence whenever |
hmm, sounds like a job for (remote) persistent workers perhaps i think this is the issue that i was saying about it running more than it should tbh - not sure - it was a while ago i worked on it iiuc it does need to do this analysis even if its not testing those files? |
if you pass all files all at once to clang, then clang analyze once no matter how many times they are included elsewhere vs using aspect this runs on each time, so the context is missing. But anyways nvm not that important for now. I think asap we should do is to bring this to CI - could you clarify what's the missing steps to close issue? |
so the thing is this is much more serious than we think - so many uncaught errors and it's increasing day by day. linter is fundamentally important CI job for any software nowadays, and I can't imagine how are we ok with this for such long time not enabling this |
someone other than me testing it - im not c++ - i can get up to speed on some things - but dont have immediate uses for the tooling personally also - was concerned about performance of it - which i think is the what you are pointing out how about we start off with running it on a schedule - we can get a measure of what its doing - and keep on top of any required fxes re rerunning the same analysis - surely bazel copes with this - even if its (annoyingly) printing out the output from when it was actually built, i would hope/expect that bazel is using its cached artefacts (assuming the inputs for the file were the same) its not super fast and the output needs work - but i think it was kinda functional - lets start using it |
scheduling or running on main branch sounds good to me |
#37378 can we merge this for now? this basically blocks everything |
…#37378) This directive was introduced in #37317 but turns out this is not available in LLVM 14. So for now we remove this. By the time we enable clang-tidy on CI we should find a way to ignore it, but for now simply remove it so that we can run clang-tidy locally. part of #28566 Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
checked code - and it doesnt - its running with those files over and again lets land it on a schedule - ill try and think of a better scheme - need to look at how the tool itself works |
fyi one thing the current toolshed / aspect based clang-tidy is missing is a way to ignore certain target - |
currently
this errors is produced for every single one of source file which sounds really weird |
yeah - i didnt figure that issue out |
Currently clang-tidy is not working very well and need some attention
I am gradually picking off various bits of ci for shifting azp -> gh
This one seems like quite a good candidate to start on the checks with.
The text was updated successfully, but these errors were encountered: