Configure clang-tidy job on CI (#6261)

This commit is contained in:
Siarhei Fedartsou
2022-06-28 01:14:28 +02:00
committed by GitHub
parent 79d4363d59
commit 59953172e8
22 changed files with 138 additions and 13 deletions
@@ -22,7 +22,7 @@ namespace datafacade
/**
* This allocator uses file backed mmap memory block as the data location.
*/
class MMapMemoryAllocator : public ContiguousBlockAllocator
class MMapMemoryAllocator final : public ContiguousBlockAllocator
{
public:
explicit MMapMemoryAllocator(const storage::StorageConfig &config);
@@ -20,7 +20,7 @@ namespace datafacade
* This class holds a unique_ptr to the memory block, so it
* is auto-freed upon destruction.
*/
class ProcessMemoryAllocator : public ContiguousBlockAllocator
class ProcessMemoryAllocator final : public ContiguousBlockAllocator
{
public:
explicit ProcessMemoryAllocator(const storage::StorageConfig &config);
@@ -20,7 +20,7 @@ namespace datafacade
* Many SharedMemoryDataFacade objects can be created that point to the same shared
* memory block.
*/
class SharedMemoryAllocator : public ContiguousBlockAllocator
class SharedMemoryAllocator final : public ContiguousBlockAllocator
{
public:
explicit SharedMemoryAllocator(
+2
View File
@@ -467,11 +467,13 @@ template <typename RTreeT, typename DataFacadeT> class GeospatialQuery
const auto forward_geometry = datafacade.GetUncompressedForwardGeometry(geometry_id);
const auto forward_weight_offset =
// NOLINTNEXTLINE(bugprone-fold-init-type)
std::accumulate(forward_weights.begin(),
forward_weights.begin() + data.fwd_segment_position,
EdgeWeight{0});
const auto forward_duration_offset =
// NOLINTNEXTLINE(bugprone-fold-init-type)
std::accumulate(forward_durations.begin(),
forward_durations.begin() + data.fwd_segment_position,
EdgeDuration{0});
@@ -304,6 +304,7 @@ InternalRouteResult shortestPathSearch(SearchEngineData<Algorithm> &engine_worki
{
BOOST_ASSERT(target_phantom.IsValidReverseTarget());
new_total_weight_to_reverse = new_total_weight_to_forward;
// NOLINTNEXTLINE(bugprone-use-after-move)
packed_leg_to_reverse = std::move(packed_leg_to_forward);
new_total_weight_to_forward = INVALID_EDGE_WEIGHT;
@@ -354,6 +355,7 @@ InternalRouteResult shortestPathSearch(SearchEngineData<Algorithm> &engine_worki
{
bool forward_to_forward =
(new_total_weight_to_forward != INVALID_EDGE_WEIGHT) &&
// NOLINTNEXTLINE(bugprone-use-after-move)
packed_leg_to_forward.front() == source_phantom.forward_segment_id.id;
bool reverse_to_forward =
(new_total_weight_to_forward != INVALID_EDGE_WEIGHT) &&
@@ -55,6 +55,7 @@ template <storage::Ownership Ownership> class IntersectionBearingsContainer
bearing_classes.end(),
bearing_counts.begin(),
[](const auto &bearings) { return bearings.getAvailableBearings().size(); });
// NOLINTNEXTLINE(bugprone-fold-init-type)
auto total_bearings = std::accumulate(bearing_counts.begin(), bearing_counts.end(), 0);
class_id_to_ranges_table = RangeTable<16>{bearing_counts};
+1 -1
View File
@@ -18,7 +18,7 @@ namespace guidance
{
// Intersection handlers deal with all issues related to intersections.
class MotorwayHandler : public IntersectionHandler
class MotorwayHandler final : public IntersectionHandler
{
public:
MotorwayHandler(const util::NodeBasedDynamicGraph &node_based_graph,
+1 -1
View File
@@ -35,7 +35,7 @@ struct RoundaboutFlags
// The roundabout handler processes all roundabout related instructions.
// It performs both the distinction between rotaries and roundabouts and
// assigns appropriate entry/exit instructions.
class RoundaboutHandler : public IntersectionHandler
class RoundaboutHandler final : public IntersectionHandler
{
public:
RoundaboutHandler(const util::NodeBasedDynamicGraph &node_based_graph,
+1 -1
View File
@@ -23,7 +23,7 @@ namespace guidance
{
// Intersection handlers deal with all issues related to intersections.
class TurnHandler : public IntersectionHandler
class TurnHandler final : public IntersectionHandler
{
public:
TurnHandler(const util::NodeBasedDynamicGraph &node_based_graph,
+3
View File
@@ -50,8 +50,11 @@ struct duplicated_node
};
} // namespace tag
using OSMNodeID = osrm::Alias<std::uint64_t, tag::osm_node_id>;
// clang-tidy fires `bugprone-throw-keyword-missing` here for unknown reason
// NOLINTNEXTLINE(bugprone-throw-keyword-missing)
static_assert(std::is_pod<OSMNodeID>(), "OSMNodeID is not a valid alias");
using OSMWayID = osrm::Alias<std::uint64_t, tag::osm_way_id>;
// NOLINTNEXTLINE(bugprone-throw-keyword-missing)
static_assert(std::is_pod<OSMWayID>(), "OSMWayID is not a valid alias");
using DuplicatedNodeID = std::uint64_t;