-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fail run-clang-tidy in case of compiler warnings / fixed Clang warnings / cleanups
#4036
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
Conversation
clang-tidy in case of a compiler warning / fixed Clang warningsclang-tidy in case of a compiler warning / fixed Clang warnings / cleanups
| { | ||
| std::set<std::string> found; | ||
| // NOLINTNEXTLINE(performance-unnecessary-copy-initialization) | ||
| const std::list<std::string> copyIn(in); |
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.
@danmar Why do you need to copy this?
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.
to allow that includePaths is passed as in parameter
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.
Wait...what? That took me quite a while to understand... We should not do that but let's tackle that at a later date.
clang-tidy in case of a compiler warning / fixed Clang warnings / cleanupsrun-clang-tidy in case of compiler warnings / fixed Clang warnings / cleanups
cmake/clang_tidy.cmake
Outdated
| if (RUN_CLANG_TIDY) | ||
| # disable all compiler warnings since we are just interested in the tidy ones | ||
| add_custom_target(run-clang-tidy ${RUN_CLANG_TIDY} -checks=-performance-unnecessary-copy-initialization -p=${CMAKE_BINARY_DIR} -j ${NPROC} -extra-arg=-w -quiet) | ||
| add_custom_target(run-clang-tidy ${RUN_CLANG_TIDY} -p=${CMAKE_BINARY_DIR} -j ${NPROC} -extra-arg=-w -quiet) |
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.
@danmar This would have affect all source files.
Interestingly this is also something we check for so the self-check should have detected this as well.
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.
It's also possible the -checks option might override the existing .clang-tidy configuration - which would be a bad thing.
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.
It's also possible the
-checksoption might override the existing.clang-tidyconfiguration - which would be a bad thing.
Actually it is appended:
--checks=<string> -
[...]
This option's value is appended to the
value of the 'Checks' option in .clang-tidy
file, if any.
f546e8a to
345e5b5
Compare
|
I created llvm/llvm-project#55018 for the |
|
This is ready for review. |
danmar
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.
there are changed ts files. please revert those changes.
Those are changed since I changed GUI source files. |
|
I do not feel I can review this PR properly since there are so many changed ts files. please revert. I suggest separate update of ts files. I think the CI needs to be less strict if it cant handle this. |
Please review by looking at the separate commits instead of the changed files. It's all very small changes which are very easy to review. The translation changes are always a separate commit to make it easier to review (even though they should be combined with the actual source changes but since we squash anyways there's no point in that).
There's an option to remove the line numbers but we need to test what the effects of this is since it is not clearly documented (apparently it is necessary if you use the QtLinguist UI for exiting them). I would prefer to do this at the beginning of a release. |
|
It seems better that we leave the ts files unchanged for some periods. no need to update them in every PR. |
Okay - so I will no longer commit them in my upcoming changes. The problem of them being outdated is only felt in the non-CMake builds (i.e. qmake) since those are not updating them implicitly like out CMake build does. The changes to them in this PR are much smaller than many of the recent one so I think it should be fine to still change them this once since the CI is already green. |
* Fix #11041 FN constVariable with array of pointers [regression] * Use std::vector for deterministic order of results, use helper variables
I don't understand why you don't revert the changes now. There is a release quite soon and they will be updated then. |
I dropped it. |
|
This is fine now and ready to be reviewed again. |
… an additional CI step
…have the proper warning flags
clang-tidywill also report compiler warnings which we were currently suppressing since we treat all warnings as errors.We should make sure our code is free of warnings. So we should fail the build in the CI (not by default) if one is encountered.
Leveraging the existing
clang-tidystep saves us an additional explicit step in the CI for aclangbuild.