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 checks for whitespace #903

Merged
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
3 changes: 1 addition & 2 deletions .github/wip.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
- locations:
- locations:
- title
- label_name
terms:
- WIP

2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
-F ref=master
--form variables[MERGE_TIME]="$(date '+%Y-%m-%d_%H:%M:%S')"
--form variables[SOURCE_SHA]="${{ github.sha }}"
https://gitlab.cern.ch/api/v4/projects/190887/trigger/pipeline
https://gitlab.cern.ch/api/v4/projects/190887/trigger/pipeline
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ repos:
types_or: [file]
files: \.(cpp|hpp|ipp|cu|cuh|sycl|hip)$

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: \.(diff|patch)$
- id: end-of-file-fixer
exclude: \.(diff|patch)$
- id: check-yaml
- id: check-added-large-files

- repo: local
hooks:
- id: check_quote_includes
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ find_package(OpenMP)
# Build the benchmark executable.
traccc_add_executable(benchmark_cpu
"toy_detector_cpu.cpp"
LINK_LIBRARIES benchmark::benchmark benchmark::benchmark_main
traccc::core traccc_benchmarks_common
LINK_LIBRARIES benchmark::benchmark benchmark::benchmark_main
traccc::core traccc_benchmarks_common
detray::core detray::detectors vecmem::core)

if(OpenMP_CXX_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/cpu/toy_detector_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ BENCHMARK_DEFINE_F(ToyDetectorBenchmark, CPU)(benchmark::State& state) {
static_cast<double>(n_events), benchmark::Counter::kIsRate);
}

BENCHMARK_REGISTER_F(ToyDetectorBenchmark, CPU)->UseRealTime();
BENCHMARK_REGISTER_F(ToyDetectorBenchmark, CPU)->UseRealTime();
4 changes: 2 additions & 2 deletions benchmarks/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

traccc_add_executable( benchmark_cuda
"toy_detector_cuda.cpp"
LINK_LIBRARIES benchmark::benchmark
LINK_LIBRARIES benchmark::benchmark
vecmem::core vecmem::cuda detray::detectors
traccc::core traccc::device_common
traccc::core traccc::device_common
traccc::cuda traccc_benchmarks_common )
2 changes: 1 addition & 1 deletion core/include/traccc/edm/impl/silicon_cell_collection.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ TRACCC_HOST_DEVICE std::weak_ordering silicon_cell<BASE>::operator<=>(
}
}

} // namespace traccc::edm
} // namespace traccc::edm
2 changes: 1 addition & 1 deletion core/include/traccc/edm/track_candidate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ using track_candidate_collection_types = collection_types<track_candidate>;
using track_candidate_container_types =
container_types<finding_result, track_candidate>;

} // namespace traccc
} // namespace traccc
2 changes: 1 addition & 1 deletion core/include/traccc/edm/track_quality.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ inline bool operator==(const track_quality& lhs, const track_quality& rhs) {
(lhs.n_holes == rhs.n_holes));
}

} // namespace traccc
} // namespace traccc
2 changes: 1 addition & 1 deletion core/include/traccc/geometry/geometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

namespace traccc {
using geometry = traccc::module_map<>;
}
}
2 changes: 1 addition & 1 deletion core/include/traccc/seeding/impl/spacepoint_formation.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ TRACCC_HOST_DEVICE inline void fill_pixel_spacepoint(edm::spacepoint<soa_t>& sp,
sp.z_variance() = 0.f;
}

} // namespace traccc::details
} // namespace traccc::details
2 changes: 1 addition & 1 deletion core/include/traccc/utils/memory_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ struct memory_resource {
vecmem::memory_resource* host = nullptr;
};

} // namespace traccc
} // namespace traccc
2 changes: 1 addition & 1 deletion core/include/traccc/utils/particle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ correct_particle_hypothesis(

} // namespace detail

} // namespace traccc
} // namespace traccc
2 changes: 1 addition & 1 deletion device/kokkos/include/traccc/kokkos/utils/definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ using range_policy = Kokkos::RangePolicy<ExecSpace>;
typedef Kokkos::TeamPolicy<ExecSpace> team_policy;
typedef Kokkos::TeamPolicy<ExecSpace>::member_type member_type;

} // namespace traccc::kokkos
} // namespace traccc::kokkos
2 changes: 1 addition & 1 deletion examples/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# Mozilla Public License Version 2.0

traccc_add_executable( create_binaries "create_binaries.cpp"
LINK_LIBRARIES vecmem::core traccc::core traccc::io traccc::options)
LINK_LIBRARIES vecmem::core traccc::core traccc::io traccc::options)
6 changes: 3 additions & 3 deletions examples/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
# Simulation with the default metadata and json inputs
traccc_add_executable(simulate "simulate.cpp"
LINK_LIBRARIES vecmem::core traccc::io traccc::core
traccc::options traccc::simulation detray::core detray::test_utils covfie::core
traccc::options traccc::simulation detray::core detray::test_utils covfie::core
Boost::filesystem)

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

traccc_add_executable(simulate_toy_detector "simulate_toy_detector.cpp"
Expand All @@ -23,5 +23,5 @@ traccc_add_executable(simulate_toy_detector "simulate_toy_detector.cpp"

traccc_add_executable(simulate_wire_chamber "simulate_wire_chamber.cpp"
LINK_LIBRARIES vecmem::core traccc::io traccc::core
traccc::options traccc::simulation detray::core detray::test_utils covfie::core
traccc::options traccc::simulation detray::core detray::test_utils covfie::core
Boost::filesystem)
2 changes: 1 addition & 1 deletion extern/detray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ set( DETRAY_SETUP_COVFIE FALSE CACHE BOOL
"Do not set up covfie as part of Detray" )

# Get it into the current directory.
FetchContent_MakeAvailable( Detray )
FetchContent_MakeAvailable( Detray )
2 changes: 1 addition & 1 deletion extern/dpl/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Build Recipe for oneDPL

This directory holds a build recipe for building
[DPL](https://github.com/oneapi-src/oneDPL) for this project.
[DPL](https://github.com/oneapi-src/oneDPL) for this project.
2 changes: 1 addition & 1 deletion io/include/traccc/io/csv/make_measurement_edm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ traccc::measurement make_measurement_edm(
const traccc::io::csv::measurement& csv_meas,
const std::map<geometry_id, geometry_id>* acts_to_detray_id);

} // namespace traccc::io::csv
} // namespace traccc::io::csv
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ class is_same_object {
#include "traccc/performance/impl/is_same_seed.ipp"
#include "traccc/performance/impl/is_same_spacepoint.ipp"
#include "traccc/performance/impl/is_same_track_candidates.ipp"
#include "traccc/performance/impl/is_same_track_parameters.ipp"
#include "traccc/performance/impl/is_same_track_parameters.ipp"
2 changes: 1 addition & 1 deletion performance/src/resolution/res_plot_tool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ class res_plot_tool {
res_plot_tool_config m_cfg; ///< The Config class
};

} // namespace traccc
} // namespace traccc
2 changes: 1 addition & 1 deletion performance/src/utils/event_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,4 @@ track_candidate_container_types::host event_data::generate_truth_candidates(
return track_candidates;
}

} // namespace traccc
} // namespace traccc
2 changes: 1 addition & 1 deletion tests/common/tests/ckf_toy_detector_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ namespace traccc {
/// Combinatorial Kalman Finding Test to Comapre CPU results
class CkfToyDetectorTests : public KalmanFittingToyDetectorTests {};

} // namespace traccc
} // namespace traccc
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ void KalmanFittingMomentumResolutionTests::SetUp() {
detray::io::write_detector(det, name_map, writer_cfg);
}

} // namespace traccc
} // namespace traccc
6 changes: 3 additions & 3 deletions tests/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# Mozilla Public License Version 2.0

# Declare the core library test(s).
traccc_add_test(core
"test_algorithm.cpp"
"test_module_map.cpp"
traccc_add_test(core
"test_algorithm.cpp"
"test_module_map.cpp"
"particle.cpp"
LINK_LIBRARIES GTest::gtest_main traccc_tests_common
traccc::core traccc::io)
2 changes: 1 addition & 1 deletion tests/core/particle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ TEST(particle, correct_particle_hypothesis) {

EXPECT_FLOAT_EQ(positron.mass(), traccc::constant<float>::m_e);
EXPECT_FLOAT_EQ(positron.charge(), 1.f);
}
}
4 changes: 2 additions & 2 deletions tests/cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ traccc_add_test(cpu
"test_track_params_estimation.cpp"
"test_sanity_ordered_on.cpp"
"test_sanity_contiguous_on.cpp"
LINK_LIBRARIES GTest::gtest_main vecmem::core
traccc_tests_common traccc::core traccc::io traccc::performance
LINK_LIBRARIES GTest::gtest_main vecmem::core
traccc_tests_common traccc::core traccc::io traccc::performance
traccc::simulation detray::core detray::detectors detray::io detray::test_utils covfie::core )
2 changes: 1 addition & 1 deletion tests/cpu/test_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ TEST(ContainerCopy, HostToHost) {
ASSERT_EQ(host_items[2].size(), 2u);
ASSERT_EQ(host_items[2][0], 2);
ASSERT_EQ(host_items[2][1], 3);
}
}
2 changes: 1 addition & 1 deletion tests/cpu/test_kalman_fitter_telescope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ INSTANTIATE_TEST_SUITE_P(
std::array<scalar, 3u>{0.f, 0.f, 0.f}, std::array<scalar, 2u>{1.f, 1.f},
std::array<scalar, 2u>{0.f, 0.f}, std::array<scalar, 2u>{0.f, 0.f},
detray::antimuon<scalar>(), 100, 100, true, 20.f, 9u, 20.f,
vector3{0, 0, 2 * traccc::unit<scalar>::T})));
vector3{0, 0, 2 * traccc::unit<scalar>::T})));
2 changes: 1 addition & 1 deletion tests/cuda/test_copy.cu
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ TEST(CUDAContainerCopy, HostToDeviceToHost) {
ASSERT_EQ(host_items[1][1], 2);
ASSERT_EQ(host_items[2][0], 2);
ASSERT_EQ(host_items[2][1], 3);
}
}
2 changes: 1 addition & 1 deletion tests/hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

enable_language(HIP)
traccc_add_test(
hip
hip
# Define the sources for the test.
test_thrust.hip
LINK_LIBRARIES
Expand Down
2 changes: 1 addition & 1 deletion tests/sycl/test_dpl.sycl
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ TEST(dpl, fill) {
ASSERT_EQ(host_vector[4], 112);
ASSERT_EQ(host_vector[5], 112);
ASSERT_EQ(host_vector[6], 112);
}
}
Loading