-
Notifications
You must be signed in to change notification settings - Fork 785
Configure CMAKE_CXX_CLANG_TIDY #5645
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
base: master
Are you sure you want to change the base?
Conversation
|
what's the difference to valhalla/.github/workflows/linux.yml Lines 191 to 192 in 524e959
|
CMakeLists.txt
Outdated
| if (ENABLE_CLANG_TIDY) | ||
| find_program(CLANG_TIDY_COMMAND NAMES clang-tidy) | ||
| if(NOT CLANG_TIDY_COMMAND) | ||
| message(FATAL_ERROR "ENABLE_CLANG_TIDY is ON but clang-tidy is not found!") | ||
| else() | ||
| message(STATUS "Found clang-tidy at ${CLANG_TIDY_COMMAND}") | ||
| set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND};--warnings-as-errors=*") | ||
| endif() | ||
| endif() |
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.
Running clang-tidy on full codebase on every PR is horribly slow. I would keep approach via scripts/clang-tidy-only-diff.sh. Still, it is a good idea to run it on all codebase every year or every release...
src/baldr/incident_singleton.h
Outdated
| using watch_function_t = std::function<void(boost::property_tree::ptree, | ||
| std::unordered_set<valhalla::baldr::GraphId>, | ||
| std::shared_ptr<state_t>, | ||
| std::function<bool(size_t)>)>; | ||
| using watch_function_t = std::function<void(const boost::property_tree::ptree&, | ||
| const std::unordered_set<valhalla::baldr::GraphId>&, | ||
| const std::shared_ptr<state_t>&, | ||
| const std::function<bool(size_t)>&)>; |
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.
well, it is better not to pass references to the separate thread because of possible lifetime issues
Well, at least it allows running clang-tidy against the whole codebase when we need it(may be indeed running it on each CI is not a good idea as @kinkard mentioned though)... but in general I'd want to at least use this opportunity to enable more checks... |
| const std::string old_to_new_file = "old_nodes_to_new_nodes.bin"; | ||
|
|
||
| uint64_t get_pbf_checksum(std::vector<std::string> paths, const std::string& tile_dir) { | ||
| uint64_t get_pbf_checksum(std::vector<std::string> paths, const std::string& /*tile_dir*/) { |
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.
oops, this could be entirely removed, it's only called once. feel free to ignore
| cxx_add_warning_flags(${library}) | ||
| endif() | ||
|
|
||
| if(ENABLE_CLANG_TIDY AND NOT MODULE_DISABLE_CLANG_TIDY) |
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.
👍
|
oops, not ready yet 😅 |
Yes, I am slowly working on it when having some spare time... |
6f6b1ca to
c0611f0
Compare
Please don't force-push once you received the first review.
Issue
I just want to experiment how easy it would be to start running clang-tidy against the whole code base on each CI run. I did something like this in OSRM already - it was successful, let's see how it will go...
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?