diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e9a6091aef..723bd7ad12 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: v21.1.8 + rev: v22.1.0 hooks: - id: clang-format # By default, the clang-format hook configures: @@ -88,7 +88,7 @@ repos: # Sorts Python imports according to PEP8 # https://www.python.org/dev/peps/pep-0008/#imports - repo: https://github.com/pycqa/isort - rev: 7.0.0 + rev: 8.0.1 hooks: - id: isort name: isort (python) diff --git a/include/openPMD/backend/Attribute.hpp b/include/openPMD/backend/Attribute.hpp index 446b4a7375..9dc621d6e7 100644 --- a/include/openPMD/backend/Attribute.hpp +++ b/include/openPMD/backend/Attribute.hpp @@ -153,9 +153,10 @@ namespace detail { U res{}; res.reserve(pv->size()); - if constexpr (std::is_convertible_v< - typename T::value_type, - typename U::value_type>) + if constexpr ( + std::is_convertible_v< + typename T::value_type, + typename U::value_type>) { std::copy(pv->begin(), pv->end(), std::back_inserter(res)); return {res}; @@ -194,9 +195,10 @@ namespace detail { U res{}; res.reserve(pv->size()); - if constexpr (std::is_convertible_v< - typename T::value_type, - typename U::value_type>) + if constexpr ( + std::is_convertible_v< + typename T::value_type, + typename U::value_type>) { std::copy(pv->begin(), pv->end(), std::back_inserter(res)); return {res}; @@ -234,9 +236,10 @@ namespace detail else if constexpr (auxiliary::IsVector_v && auxiliary::IsArray_v) { U res{}; - if constexpr (std::is_convertible_v< - typename T::value_type, - typename U::value_type>) + if constexpr ( + std::is_convertible_v< + typename T::value_type, + typename U::value_type>) { if (res.size() != pv->size()) { diff --git a/src/IO/ADIOS/ADIOS2File.cpp b/src/IO/ADIOS/ADIOS2File.cpp index 1d20aeb04d..af2d42640c 100644 --- a/src/IO/ADIOS/ADIOS2File.cpp +++ b/src/IO/ADIOS/ADIOS2File.cpp @@ -114,9 +114,10 @@ void WriteDataset::call(ADIOS2File &ba, detail::BufferedPut &bp) engine.Put(var, ptr); } - else if constexpr (std::is_same_v< - ptr_type, - auxiliary::WriteBuffer::CopyableUniquePtr>) + else if constexpr ( + std::is_same_v< + ptr_type, + auxiliary::WriteBuffer::CopyableUniquePtr>) { BufferedUniquePtrPut bput; bput.name = std::move(bp.name); diff --git a/src/IO/JSON/JSONIOHandler.cpp b/src/IO/JSON/JSONIOHandler.cpp index 03cef438d3..c531aabb00 100644 --- a/src/IO/JSON/JSONIOHandler.cpp +++ b/src/IO/JSON/JSONIOHandler.cpp @@ -32,7 +32,8 @@ JSONIOHandler::JSONIOHandler( openPMD::json::TracingJSON jsonCfg, JSONIOHandlerImpl::FileFormat format, std::string originalExtension) - : AbstractIOHandler{std::move(initialize_from), std::move(path), at, std::move(jsonCfg)} + : AbstractIOHandler{ + std::move(initialize_from), std::move(path), at, std::move(jsonCfg)} , m_impl{this, format, std::move(originalExtension)} {} @@ -45,7 +46,8 @@ JSONIOHandler::JSONIOHandler( openPMD::json::TracingJSON jsonCfg, JSONIOHandlerImpl::FileFormat format, std::string originalExtension) - : AbstractIOHandler{std::move(initialize_from), std::move(path), at, std::move(jsonCfg)} + : AbstractIOHandler{ + std::move(initialize_from), std::move(path), at, std::move(jsonCfg)} , m_impl{ JSONIOHandlerImpl{this, comm, format, std::move(originalExtension)}} {} diff --git a/src/Iteration.cpp b/src/Iteration.cpp index ab35c1e3ae..d668ac3c08 100644 --- a/src/Iteration.cpp +++ b/src/Iteration.cpp @@ -513,9 +513,10 @@ void Iteration::read_impl(std::string const &groupPath) setDt(Attribute(Attribute::from_any, *aRead.m_resource) .get()); // conversion cast if a backend reports an integer type - else if (auto val = Attribute(Attribute::from_any, *aRead.m_resource) - .getOptional(); - val.has_value()) + else if ( + auto val = Attribute(Attribute::from_any, *aRead.m_resource) + .getOptional(); + val.has_value()) setDt(val.value()); else throw error::ReadError( @@ -539,9 +540,10 @@ void Iteration::read_impl(std::string const &groupPath) setTime(Attribute(Attribute::from_any, *aRead.m_resource) .get()); // conversion cast if a backend reports an integer type - else if (auto val = Attribute(Attribute::from_any, *aRead.m_resource) - .getOptional(); - val.has_value()) + else if ( + auto val = Attribute(Attribute::from_any, *aRead.m_resource) + .getOptional(); + val.has_value()) setTime(val.value()); else throw error::ReadError( diff --git a/src/Series.cpp b/src/Series.cpp index a826303193..6316735644 100644 --- a/src/Series.cpp +++ b/src/Series.cpp @@ -2581,8 +2581,9 @@ std::string Series::iterationFilename(IterationIndex_t i) { return series.m_overrideFilebasedFilename.value(); } - else if (auto iteration = series.m_iterationFilenames.find(i); // - iteration != series.m_iterationFilenames.end()) + else if ( + auto iteration = series.m_iterationFilenames.find(i); // + iteration != series.m_iterationFilenames.end()) { return iteration->second; } diff --git a/src/backend/BaseRecord.cpp b/src/backend/BaseRecord.cpp index 9c2161be0a..be07f00f19 100644 --- a/src/backend/BaseRecord.cpp +++ b/src/backend/BaseRecord.cpp @@ -801,9 +801,10 @@ inline void BaseRecord::readBase() "timeOffset", Attribute(Attribute::from_any, *aRead.m_resource).get()); // conversion cast if a backend reports an integer type - else if (auto val = Attribute(Attribute::from_any, *aRead.m_resource) - .getOptional(); - val.has_value()) + else if ( + auto val = Attribute(Attribute::from_any, *aRead.m_resource) + .getOptional(); + val.has_value()) this->setAttribute("timeOffset", val.value()); else throw std::runtime_error( diff --git a/src/binding/python/Attributable.cpp b/src/binding/python/Attributable.cpp index 23795276ce..e8ec058656 100644 --- a/src/binding/python/Attributable.cpp +++ b/src/binding/python/Attributable.cpp @@ -422,15 +422,17 @@ bool setAttributeFromObject_char( #endif // this must come after tryCast>, // because tryCast> implicitly covers chars as well - else if (auto list_of_string = tryCast(obj); - list_of_string.has_value()) + else if ( + auto list_of_string = tryCast(obj); + list_of_string.has_value()) { return attr.setAttribute(key, std::move(*list_of_string)); } // Again: `char` vs. `signed char`, resp. `char` vs. `unsigned char` // depending on `char`'s signedness. - else if (auto list_of_int = tryCast>(obj); - list_of_int.has_value()) + else if ( + auto list_of_int = tryCast>(obj); + list_of_int.has_value()) { std::vector casted; casted.reserve(list_of_int->size());