From c6c8cb0deadc7aeceec50f847c5efcf54b37a708 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Thu, 30 Jun 2022 15:32:12 +0200 Subject: [PATCH] Enable more clang-tidy checks. (#6270) * Enable more clang-tidy checks --- .clang-tidy | 12 ++++----- CHANGELOG.md | 1 + .../contractor/contract_excludable_graph.hpp | 2 +- include/engine/datafacade_factory.hpp | 2 +- include/extractor/raster_source.hpp | 1 - include/extractor/restriction.hpp | 2 +- include/guidance/turn_bearing.hpp | 5 +--- include/guidance/turn_lane_handler.hpp | 12 --------- include/server/server.hpp | 2 +- include/storage/io_config.hpp | 7 ++--- include/storage/shared_datatype.hpp | 2 +- include/util/exception.hpp | 27 ++++++++++--------- include/util/exception_utils.hpp | 2 +- include/util/guidance/name_announcements.hpp | 4 +-- include/util/range_table.hpp | 6 +++++ src/customize/customizer.cpp | 3 ++- src/engine/api/json_factory.cpp | 3 +-- src/extractor/intersection/intersection.cpp | 2 -- src/guidance/driveway_handler.cpp | 3 --- src/guidance/turn_handler.cpp | 2 +- src/partitioner/dinic_max_flow.cpp | 2 +- src/updater/updater.cpp | 2 +- src/util/conditional_restrictions.cpp | 1 - unit_tests/common/range_tools.hpp | 2 +- unit_tests/engine/geometry_string.cpp | 2 +- unit_tests/library/match.cpp | 6 +++-- unit_tests/library/tile.cpp | 2 +- unit_tests/library/waypoint_check.hpp | 8 +++--- .../partitioner/bisection_to_partition.cpp | 2 +- unit_tests/partitioner/graph_generator.hpp | 11 ++++---- .../partitioner/multi_level_partition.cpp | 2 +- .../partitioner/recursive_bisection.cpp | 2 +- unit_tests/partitioner/remove_unconnected.cpp | 2 +- unit_tests/server/parameters_parser.cpp | 2 +- unit_tests/server/url_parser.cpp | 2 +- 35 files changed, 69 insertions(+), 79 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 9581f45b814..72e02cb40ac 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -9,14 +9,12 @@ Checks: > -bugprone-implicit-widening-of-multiplication-result, -bugprone-integer-division, -bugprone-reserved-identifier, - -bugprone-macro-parentheses, -bugprone-unhandled-self-assignment, - -bugprone-suspicious-missing-comma, -bugprone-forward-declaration-namespace, -bugprone-sizeof-expression, -clang-analyzer-*, - -clang-diagnostic-unused-local-typedef, -clang-diagnostic-deprecated-declarations, + -clang-diagnostic-constant-conversion, google-*, -google-build-explicit-make-pair, -google-build-using-namespace, @@ -29,7 +27,6 @@ Checks: > -google-readability-todo, -google-runtime-int, -google-build-namespaces, - -google-global-names-in-headers, -google-runtime-references, -google-readability-function-size, llvm-*, @@ -42,14 +39,17 @@ Checks: > misc-*, -misc-argument-comment, -misc-non-private-member-variables-in-classes, - -misc-unused-using-decls, -misc-unconventional-assign-operator, -misc-redundant-expression, -misc-no-recursion, -misc-misplaced-const, -misc-definitions-in-headers, - -misc-unused-alias-decls, -misc-unused-parameters, + performance-*, + -performance-noexcept-move-constructor, + -performance-move-const-arg, + -performance-no-int-to-ptr, + -performance-unnecessary-value-param, readability-*, -readability-avoid-const-params-in-decls, -readability-braces-around-statements, diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ce4f393dd6..dbfdb844c17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - API: - FIXED: Fix inefficient osrm-routed connection handling [#6113](https://github.com/Project-OSRM/osrm-backend/pull/6113) - Build: + - CHANGED: Enable more clang-tidy checks. [#6262](https://github.com/Project-OSRM/osrm-backend/pull/6270) - CHANGED: Configure clang-tidy job on CI. [#6261](https://github.com/Project-OSRM/osrm-backend/pull/6261) - CHANGED: Use Github Actions for building container images [#6138](https://github.com/Project-OSRM/osrm-backend/pull/6138) - CHANGED: Upgrade Boost dependency to 1.70 [#6113](https://github.com/Project-OSRM/osrm-backend/pull/6113) diff --git a/include/contractor/contract_excludable_graph.hpp b/include/contractor/contract_excludable_graph.hpp index 74ea8373b71..9d0cc697924 100644 --- a/include/contractor/contract_excludable_graph.hpp +++ b/include/contractor/contract_excludable_graph.hpp @@ -18,7 +18,7 @@ inline auto contractFullGraph(ContractorGraph contractor_graph, std::vector node_weights) { auto num_nodes = contractor_graph.GetNumberOfNodes(); - contractGraph(contractor_graph, node_weights); + contractGraph(contractor_graph, std::move(node_weights)); auto edges = toEdges(std::move(contractor_graph)); std::vector edge_filter(edges.size(), true); diff --git a/include/engine/datafacade_factory.hpp b/include/engine/datafacade_factory.hpp index 853716be950..e01c70f7275 100644 --- a/include/engine/datafacade_factory.hpp +++ b/include/engine/datafacade_factory.hpp @@ -65,7 +65,7 @@ template