diff --git a/.github/workflows/clang-format/clang-format.sh b/.github/workflows/clang-format/clang-format.sh index 0b99c629ab..3824f780f1 100755 --- a/.github/workflows/clang-format/clang-format.sh +++ b/.github/workflows/clang-format/clang-format.sh @@ -2,11 +2,11 @@ if (( $# > 0 )); then # received arguments, format those files - clang-format-13 -i "$@" + clang-format-18 -i "$@" else # received no arguments, find files on our own find include/ src/ test/ examples/ \ -regextype egrep \ -type f -regex '.*\.(hpp|cpp|hpp\.in)$' \ - | xargs clang-format-13 -i + | xargs clang-format-18 -i fi diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3a3f82acb..d8529b3cee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -66,7 +66,7 @@ repos: # clang-format v13 # to run manually, use .github/workflows/clang-format/clang-format.sh - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v17.0.6 + rev: v18.1.2 hooks: - id: clang-format # By default, the clang-format hook configures: diff --git a/environment.yml b/environment.yml index 5cdc6f6f02..1840e99d59 100644 --- a/environment.yml +++ b/environment.yml @@ -3,5 +3,5 @@ name: openPMD-api-dev channels: - conda-forge dependencies: - - clang-format-12=12.0.1 + - clang-format-18=18.1.2 - bash=5 diff --git a/include/openPMD/RecordComponent.hpp b/include/openPMD/RecordComponent.hpp index c0b04a2a4c..1c96981bb5 100644 --- a/include/openPMD/RecordComponent.hpp +++ b/include/openPMD/RecordComponent.hpp @@ -479,7 +479,8 @@ class RecordComponent : public BaseRecordComponent */ template auto visit(Args &&...args) -> decltype(Visitor::template call( - std::declval(), std::forward(args)...)); + std::declval(), + std::forward(args)...)); static constexpr char const *const SCALAR = "\vScalar"; diff --git a/include/openPMD/RecordComponent.tpp b/include/openPMD/RecordComponent.tpp index db6f68636c..a39325540e 100644 --- a/include/openPMD/RecordComponent.tpp +++ b/include/openPMD/RecordComponent.tpp @@ -135,11 +135,9 @@ RecordComponent::loadChunk(std::shared_ptr data, Offset o, Extent e) if (extent.size() != dim || offset.size() != dim) { std::ostringstream oss; - oss << "Dimensionality of chunk (" - << "offset=" << offset.size() << "D, " - << "extent=" << extent.size() << "D) " - << "and record component (" << int(dim) << "D) " - << "do not match."; + oss << "Dimensionality of chunk (" << "offset=" << offset.size() + << "D, " << "extent=" << extent.size() << "D) " + << "and record component (" << int(dim) << "D) " << "do not match."; throw std::runtime_error(oss.str()); } Extent dse = getExtent(); diff --git a/src/RecordComponent.cpp b/src/RecordComponent.cpp index 0011363bc4..d8ebda0113 100644 --- a/src/RecordComponent.cpp +++ b/src/RecordComponent.cpp @@ -499,8 +499,8 @@ void RecordComponent::verifyChunk( { std::ostringstream oss; oss << "Joined array: Must specify an empty offset (given: " - << "offset=" << o.size() << "D, " - << "extent=" << e.size() << "D)."; + << "offset=" << o.size() << "D, " << "extent=" << e.size() + << "D)."; throw std::runtime_error(oss.str()); } if (e.size() != dim) @@ -508,8 +508,8 @@ void RecordComponent::verifyChunk( std::ostringstream oss; oss << "Joined array: Dimensionalities of chunk extent and dataset " "extent must be equivalent (given: " - << "offset=" << o.size() << "D, " - << "extent=" << e.size() << "D)."; + << "offset=" << o.size() << "D, " << "extent=" << e.size() + << "D)."; throw std::runtime_error(oss.str()); } for (size_t i = 0; i < dim; ++i) @@ -529,11 +529,9 @@ void RecordComponent::verifyChunk( if (e.size() != dim || o.size() != dim) { std::ostringstream oss; - oss << "Dimensionality of chunk (" - << "offset=" << o.size() << "D, " - << "extent=" << e.size() << "D) " - << "and record component (" << int(dim) << "D) " - << "do not match."; + oss << "Dimensionality of chunk (" << "offset=" << o.size() << "D, " + << "extent=" << e.size() << "D) " << "and record component (" + << int(dim) << "D) " << "do not match."; throw std::runtime_error(oss.str()); } for (uint8_t i = 0; i < dim; ++i) diff --git a/test/ParallelIOTest.cpp b/test/ParallelIOTest.cpp index 9f3ae43ee2..72c376cb63 100644 --- a/test/ParallelIOTest.cpp +++ b/test/ParallelIOTest.cpp @@ -414,8 +414,7 @@ void available_chunks_test(std::string const &file_ending) "parameters": { "NumAggregators":)END" - << "\"" << std::to_string(mpi_size) << "\"" - << R"END( + << "\"" << std::to_string(mpi_size) << "\"" << R"END( } } } @@ -957,8 +956,7 @@ void hipace_like_write(std::string const &file_ending) int const step = first_rank_step - my_first_step; if (verbose) - std::cout << "[" << i_mpi_rank << "] " - << "step: " << step + std::cout << "[" << i_mpi_rank << "] " << "step: " << step << " | first_ranks_step: " << first_rank_step << std::endl; // do we start writing to a new step?