Skip to content

Commit 25b79bf

Browse files
committedMar 7, 2025··
Add pre-commit checks for whitespace
This commit adds some additional pre-commit hooks for trailing whitespace and end-of-file markers.
1 parent 85dc207 commit 25b79bf

32 files changed

+48
-39
lines changed
 

‎.github/wip.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
- locations:
1+
- locations:
22
- title
33
- label_name
44
terms:
55
- WIP
6-

‎.github/workflows/benchmarks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
-F ref=master
1616
--form variables[MERGE_TIME]="$(date '+%Y-%m-%d_%H:%M:%S')"
1717
--form variables[SOURCE_SHA]="${{ github.sha }}"
18-
https://gitlab.cern.ch/api/v4/projects/190887/trigger/pipeline
18+
https://gitlab.cern.ch/api/v4/projects/190887/trigger/pipeline

‎.pre-commit-config.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ repos:
66
types_or: [file]
77
files: \.(cpp|hpp|ipp|cu|cuh|sycl|hip)$
88

9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v5.0.0
11+
hooks:
12+
- id: trailing-whitespace
13+
exclude: \.(diff|patch)$
14+
- id: end-of-file-fixer
15+
exclude: \.(diff|patch)$
16+
- id: check-yaml
17+
- id: check-added-large-files
18+
919
- repo: local
1020
hooks:
1121
- id: check_quote_includes

‎benchmarks/cpu/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ find_package(OpenMP)
1010
# Build the benchmark executable.
1111
traccc_add_executable(benchmark_cpu
1212
"toy_detector_cpu.cpp"
13-
LINK_LIBRARIES benchmark::benchmark benchmark::benchmark_main
14-
traccc::core traccc_benchmarks_common
13+
LINK_LIBRARIES benchmark::benchmark benchmark::benchmark_main
14+
traccc::core traccc_benchmarks_common
1515
detray::core detray::detectors vecmem::core)
1616

1717
if(OpenMP_CXX_FOUND)

‎benchmarks/cpu/toy_detector_cpu.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ BENCHMARK_DEFINE_F(ToyDetectorBenchmark, CPU)(benchmark::State& state) {
8888
static_cast<double>(n_events), benchmark::Counter::kIsRate);
8989
}
9090

91-
BENCHMARK_REGISTER_F(ToyDetectorBenchmark, CPU)->UseRealTime();
91+
BENCHMARK_REGISTER_F(ToyDetectorBenchmark, CPU)->UseRealTime();

‎benchmarks/cuda/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
traccc_add_executable( benchmark_cuda
88
"toy_detector_cuda.cpp"
9-
LINK_LIBRARIES benchmark::benchmark
9+
LINK_LIBRARIES benchmark::benchmark
1010
vecmem::core vecmem::cuda detray::detectors
11-
traccc::core traccc::device_common
11+
traccc::core traccc::device_common
1212
traccc::cuda traccc_benchmarks_common )

‎core/include/traccc/edm/impl/silicon_cell_collection.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ TRACCC_HOST_DEVICE std::weak_ordering silicon_cell<BASE>::operator<=>(
6363
}
6464
}
6565

66-
} // namespace traccc::edm
66+
} // namespace traccc::edm

‎core/include/traccc/edm/track_candidate.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ using track_candidate_collection_types = collection_types<track_candidate>;
4444
using track_candidate_container_types =
4545
container_types<finding_result, track_candidate>;
4646

47-
} // namespace traccc
47+
} // namespace traccc

‎core/include/traccc/edm/track_quality.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ inline bool operator==(const track_quality& lhs, const track_quality& rhs) {
4444
(lhs.n_holes == rhs.n_holes));
4545
}
4646

47-
} // namespace traccc
47+
} // namespace traccc

‎core/include/traccc/geometry/geometry.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

1313
namespace traccc {
1414
using geometry = traccc::module_map<>;
15-
}
15+
}

‎core/include/traccc/seeding/impl/spacepoint_formation.ipp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ TRACCC_HOST_DEVICE inline void fill_pixel_spacepoint(edm::spacepoint<soa_t>& sp,
4040
sp.z_variance() = 0.f;
4141
}
4242

43-
} // namespace traccc::details
43+
} // namespace traccc::details

‎core/include/traccc/utils/memory_resource.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ struct memory_resource {
2222
vecmem::memory_resource* host = nullptr;
2323
};
2424

25-
} // namespace traccc
25+
} // namespace traccc

‎core/include/traccc/utils/particle.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ correct_particle_hypothesis(
101101

102102
} // namespace detail
103103

104-
} // namespace traccc
104+
} // namespace traccc

‎device/kokkos/include/traccc/kokkos/utils/definitions.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ using range_policy = Kokkos::RangePolicy<ExecSpace>;
2727
typedef Kokkos::TeamPolicy<ExecSpace> team_policy;
2828
typedef Kokkos::TeamPolicy<ExecSpace>::member_type member_type;
2929

30-
} // namespace traccc::kokkos
30+
} // namespace traccc::kokkos

‎examples/io/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# Mozilla Public License Version 2.0
66

77
traccc_add_executable( create_binaries "create_binaries.cpp"
8-
LINK_LIBRARIES vecmem::core traccc::core traccc::io traccc::options)
8+
LINK_LIBRARIES vecmem::core traccc::core traccc::io traccc::options)

‎examples/simulation/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
# Simulation with the default metadata and json inputs
88
traccc_add_executable(simulate "simulate.cpp"
99
LINK_LIBRARIES vecmem::core traccc::io traccc::core
10-
traccc::options traccc::simulation detray::core detray::test_utils covfie::core
10+
traccc::options traccc::simulation detray::core detray::test_utils covfie::core
1111
Boost::filesystem)
1212

1313
# Simulation with the detectors pre-built in detray
1414
traccc_add_executable(simulate_telescope "simulate_telescope.cpp"
1515
LINK_LIBRARIES vecmem::core traccc::io traccc::core
16-
traccc::options traccc::simulation detray::core detray::test_utils covfie::core
16+
traccc::options traccc::simulation detray::core detray::test_utils covfie::core
1717
Boost::filesystem)
1818

1919
traccc_add_executable(simulate_toy_detector "simulate_toy_detector.cpp"
@@ -23,5 +23,5 @@ traccc_add_executable(simulate_toy_detector "simulate_toy_detector.cpp"
2323

2424
traccc_add_executable(simulate_wire_chamber "simulate_wire_chamber.cpp"
2525
LINK_LIBRARIES vecmem::core traccc::io traccc::core
26-
traccc::options traccc::simulation detray::core detray::test_utils covfie::core
26+
traccc::options traccc::simulation detray::core detray::test_utils covfie::core
2727
Boost::filesystem)

‎extern/detray/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ set( DETRAY_SETUP_COVFIE FALSE CACHE BOOL
5252
"Do not set up covfie as part of Detray" )
5353

5454
# Get it into the current directory.
55-
FetchContent_MakeAvailable( Detray )
55+
FetchContent_MakeAvailable( Detray )

‎extern/dpl/README.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Build Recipe for oneDPL
22

33
This directory holds a build recipe for building
4-
[DPL](https://github.com/oneapi-src/oneDPL) for this project.
4+
[DPL](https://github.com/oneapi-src/oneDPL) for this project.

‎io/include/traccc/io/csv/make_measurement_edm.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ traccc::measurement make_measurement_edm(
2525
const traccc::io::csv::measurement& csv_meas,
2626
const std::map<geometry_id, geometry_id>* acts_to_detray_id);
2727

28-
} // namespace traccc::io::csv
28+
} // namespace traccc::io::csv

‎performance/include/traccc/performance/details/is_same_object.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ class is_same_object {
5151
#include "traccc/performance/impl/is_same_seed.ipp"
5252
#include "traccc/performance/impl/is_same_spacepoint.ipp"
5353
#include "traccc/performance/impl/is_same_track_candidates.ipp"
54-
#include "traccc/performance/impl/is_same_track_parameters.ipp"
54+
#include "traccc/performance/impl/is_same_track_parameters.ipp"

‎performance/src/resolution/res_plot_tool.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ class res_plot_tool {
7171
res_plot_tool_config m_cfg; ///< The Config class
7272
};
7373

74-
} // namespace traccc
74+
} // namespace traccc

‎performance/src/utils/event_data.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,4 +338,4 @@ track_candidate_container_types::host event_data::generate_truth_candidates(
338338
return track_candidates;
339339
}
340340

341-
} // namespace traccc
341+
} // namespace traccc

‎tests/common/tests/ckf_toy_detector_test.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ namespace traccc {
1515
/// Combinatorial Kalman Finding Test to Comapre CPU results
1616
class CkfToyDetectorTests : public KalmanFittingToyDetectorTests {};
1717

18-
} // namespace traccc
18+
} // namespace traccc

‎tests/common/tests/kalman_fitting_momentum_resolution_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,4 @@ void KalmanFittingMomentumResolutionTests::SetUp() {
159159
detray::io::write_detector(det, name_map, writer_cfg);
160160
}
161161

162-
} // namespace traccc
162+
} // namespace traccc

‎tests/core/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# Mozilla Public License Version 2.0
66

77
# Declare the core library test(s).
8-
traccc_add_test(core
9-
"test_algorithm.cpp"
10-
"test_module_map.cpp"
8+
traccc_add_test(core
9+
"test_algorithm.cpp"
10+
"test_module_map.cpp"
1111
"particle.cpp"
1212
LINK_LIBRARIES GTest::gtest_main traccc_tests_common
1313
traccc::core traccc::io)

‎tests/core/particle.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ TEST(particle, correct_particle_hypothesis) {
4545

4646
EXPECT_FLOAT_EQ(positron.mass(), traccc::constant<float>::m_e);
4747
EXPECT_FLOAT_EQ(positron.charge(), 1.f);
48-
}
48+
}

‎tests/cpu/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ traccc_add_test(cpu
2424
"test_track_params_estimation.cpp"
2525
"test_sanity_ordered_on.cpp"
2626
"test_sanity_contiguous_on.cpp"
27-
LINK_LIBRARIES GTest::gtest_main vecmem::core
28-
traccc_tests_common traccc::core traccc::io traccc::performance
27+
LINK_LIBRARIES GTest::gtest_main vecmem::core
28+
traccc_tests_common traccc::core traccc::io traccc::performance
2929
traccc::simulation detray::core detray::detectors detray::io detray::test_utils covfie::core )

‎tests/cpu/test_copy.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ TEST(ContainerCopy, HostToHost) {
5353
ASSERT_EQ(host_items[2].size(), 2u);
5454
ASSERT_EQ(host_items[2][0], 2);
5555
ASSERT_EQ(host_items[2][1], 3);
56-
}
56+
}

‎tests/cpu/test_kalman_fitter_telescope.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,4 +231,4 @@ INSTANTIATE_TEST_SUITE_P(
231231
std::array<scalar, 3u>{0.f, 0.f, 0.f}, std::array<scalar, 2u>{1.f, 1.f},
232232
std::array<scalar, 2u>{0.f, 0.f}, std::array<scalar, 2u>{0.f, 0.f},
233233
detray::antimuon<scalar>(), 100, 100, true, 20.f, 9u, 20.f,
234-
vector3{0, 0, 2 * traccc::unit<scalar>::T})));
234+
vector3{0, 0, 2 * traccc::unit<scalar>::T})));

‎tests/cuda/test_copy.cu

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ TEST(CUDAContainerCopy, HostToDeviceToHost) {
118118
ASSERT_EQ(host_items[1][1], 2);
119119
ASSERT_EQ(host_items[2][0], 2);
120120
ASSERT_EQ(host_items[2][1], 3);
121-
}
121+
}

‎tests/hip/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
enable_language(HIP)
88
traccc_add_test(
9-
hip
9+
hip
1010
# Define the sources for the test.
1111
test_thrust.hip
1212
LINK_LIBRARIES

‎tests/sycl/test_dpl.sycl

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@ TEST(dpl, fill) {
134134
ASSERT_EQ(host_vector[4], 112);
135135
ASSERT_EQ(host_vector[5], 112);
136136
ASSERT_EQ(host_vector[6], 112);
137-
}
137+
}

0 commit comments

Comments
 (0)
Please sign in to comment.