Skip to content
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

Add pre-commit job to check quote includes #871

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/check_quote_includes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

if ! [ -x "$(command -v rg)" ]; then
GREP="grep -R"
else
GREP="rg -j 1 --no-heading -N"
fi

${GREP} "#include \"vecmem" "$@" ; test $? -eq 1 || exit 1
${GREP} "#include \"detray" "$@" ; test $? -eq 1 || exit 1
${GREP} "#include \"Acts" "$@" ; test $? -eq 1 || exit 1
${GREP} "#include \"covfie" "$@" ; test $? -eq 1 || exit 1
${GREP} "#include \"algebra" "$@" ; test $? -eq 1 || exit 1
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ repos:
- id: clang-format
types_or: [file]
files: \.(cpp|hpp|ipp|cu|cuh|sycl|hip)$

- repo: local
hooks:
- id: check_quote_includes
name: Check includes with quotes
language: system
entry: .github/check_quote_includes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

#include <mutex>
#include <vecmem/memory/device_atomic_ref.hpp>

#include "traccc/clusterization/clustering_config.hpp"
#include "traccc/clusterization/device/aggregate_cluster.hpp"
Expand All @@ -18,7 +19,6 @@
#include "traccc/device/mutex.hpp"
#include "traccc/device/unique_lock.hpp"
#include "traccc/edm/silicon_cell_collection.hpp"
#include "vecmem/memory/device_atomic_ref.hpp"

namespace traccc::device {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "traccc/utils/memory_resource.hpp"

// VecMem include(s).
#include "vecmem/utils/cuda/copy.hpp"
#include <vecmem/utils/cuda/copy.hpp>

namespace traccc::cuda {

Expand Down
2 changes: 1 addition & 1 deletion device/cuda/src/seeding/seed_finding.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "traccc/seeding/device/update_triplet_weights.hpp"

// VecMem include(s).
#include "vecmem/utils/cuda/copy.hpp"
#include <vecmem/utils/cuda/copy.hpp>

// System include(s).
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@

#pragma once

#include <vecmem/memory/memory_resource.hpp>

#include "traccc/edm/cell.hpp"
#include "traccc/edm/measurement.hpp"
#include "traccc/utils/algorithm.hpp"
#include "vecmem/memory/memory_resource.hpp"

namespace traccc::futhark {
struct component_connection : algorithm<measurement_container_types::host(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "traccc/utils/memory_resource.hpp"

// VecMem include(s).
#include "vecmem/utils/sycl/copy.hpp"
#include <vecmem/utils/sycl/copy.hpp>

namespace traccc::sycl {

Expand All @@ -31,4 +31,4 @@ vecmem::data::vector_buffer<device::prefix_sum_element_t> make_prefix_sum_buff(
const std::vector<device::prefix_sum_size_t>& sizes, vecmem::copy& copy,
const traccc::memory_resource& mr, ::sycl::queue& queue);

} // namespace traccc::sycl
} // namespace traccc::sycl
3 changes: 1 addition & 2 deletions tests/common/tests/atlas_cuts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@

#pragma once

#include <Acts/Seeding/IExperimentCuts.hpp>
#include <algorithm>

#include "Acts/Seeding/IExperimentCuts.hpp"

namespace Acts {
template <typename SpacePoint>
class ATLASCuts : public IExperimentCuts<SpacePoint> {
Expand Down
28 changes: 14 additions & 14 deletions tests/cpu/compare_with_acts_seeding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
#include "tests/atlas_cuts.hpp"

// acts
#include "Acts/EventData/Seed.hpp"
#include "Acts/EventData/SpacePointContainer.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/MagneticField/ConstantBField.hpp"
#include "Acts/Seeding/BinnedGroup.hpp"
#include "Acts/Seeding/EstimateTrackParamsFromSeed.hpp"
#include "Acts/Seeding/SeedFilter.hpp"
#include "Acts/Seeding/SeedFinder.hpp"
#include "Acts/Seeding/SpacePointGrid.hpp"
#include "Acts/Surfaces/DiscSurface.hpp"
#include "Acts/Surfaces/PlaneSurface.hpp"
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/GridBinFinder.hpp"
#include "Acts/Utilities/Helpers.hpp"
#include <Acts/EventData/Seed.hpp>
#include <Acts/EventData/SpacePointContainer.hpp>
#include <Acts/Geometry/GeometryContext.hpp>
#include <Acts/MagneticField/ConstantBField.hpp>
#include <Acts/Seeding/BinnedGroup.hpp>
#include <Acts/Seeding/EstimateTrackParamsFromSeed.hpp>
#include <Acts/Seeding/SeedFilter.hpp>
#include <Acts/Seeding/SeedFinder.hpp>
#include <Acts/Seeding/SpacePointGrid.hpp>
#include <Acts/Surfaces/DiscSurface.hpp>
#include <Acts/Surfaces/PlaneSurface.hpp>
#include <Acts/Surfaces/Surface.hpp>
#include <Acts/Utilities/GridBinFinder.hpp>
#include <Acts/Utilities/Helpers.hpp>

// VecMem
#include <vecmem/memory/host_memory_resource.hpp>
Expand Down
2 changes: 1 addition & 1 deletion tests/cpu/test_cca.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "tests/cca_test.hpp"

// VecMem include(s).
#include "vecmem/memory/host_memory_resource.hpp"
#include <vecmem/memory/host_memory_resource.hpp>

// GTest include(s).
#include <gtest/gtest.h>
Expand Down
Loading