Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (openPMD#1602)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/mirrors-clang-format: v17.0.6 → v18.1.2](pre-commit/mirrors-clang-format@v17.0.6...v18.1.2)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* More `clang-format-18` Scripts

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Axel Huebl <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and ax3l authored Mar 26, 2024
1 parent e4ce81f commit 3feb5c5
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/clang-format/clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion include/openPMD/RecordComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ class RecordComponent : public BaseRecordComponent
*/
template <typename Visitor, typename... Args>
auto visit(Args &&...args) -> decltype(Visitor::template call<char>(
std::declval<RecordComponent &>(), std::forward<Args>(args)...));
std::declval<RecordComponent &>(),
std::forward<Args>(args)...));

static constexpr char const *const SCALAR = "\vScalar";

Expand Down
8 changes: 3 additions & 5 deletions include/openPMD/RecordComponent.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@ RecordComponent::loadChunk(std::shared_ptr<T> 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();
Expand Down
16 changes: 7 additions & 9 deletions src/RecordComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,17 +499,17 @@ 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)
{
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)
Expand All @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions test/ParallelIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
}
}
}
Expand Down Expand Up @@ -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?
Expand Down

0 comments on commit 3feb5c5

Please sign in to comment.