From 405570630aef19c77468f4a922f725d76fe58377 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Wed, 29 Jun 2022 21:51:48 +0200 Subject: [PATCH] Enable more clang-tidy checks --- .clang-tidy | 11 ++++---- 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 - 23 files changed, 45 insertions(+), 59 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 9581f45b814..d1e92a31505 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -9,13 +9,10 @@ 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, google-*, -google-build-explicit-make-pair, @@ -29,7 +26,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 +38,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