From a5d84297fcde8f31f9ac22495fad9c04061dcb81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sun, 9 Jul 2023 17:04:39 +0200 Subject: [PATCH] Fix some formatting with clang-format. --- .github/workflows/linting.yml | 2 +- src/proxy/resource.h | 2 +- .../pybind11_qt/details/pybind11_qt_sip.h | 3 +-- .../pybind11_qt/pybind11_qt_containers.h | 17 ++++++----------- .../include/pybind11_qt/pybind11_qt_enums.h | 3 +-- .../include/pybind11_qt/pybind11_qt_objects.h | 6 ++---- .../include/pybind11_utils/functional.h | 5 +---- .../include/pybind11_utils/shared_cpp_owner.h | 6 ++---- .../pybind11_utils/smart_variant_wrapper.h | 3 +-- 9 files changed, 16 insertions(+), 31 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 4be2b83..ffb0c19 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -8,5 +8,5 @@ jobs: - name: Run clang-format uses: jidicula/clang-format-action@v4.11.0 with: - clang-format-version: "13" + clang-format-version: "15" check-path: "." diff --git a/src/proxy/resource.h b/src/proxy/resource.h index 5d1c273..52c87a6 100644 --- a/src/proxy/resource.h +++ b/src/proxy/resource.h @@ -3,4 +3,4 @@ #define IDR_LOADER_DLL 100 -#endif // RESOURCE_H +#endif // RESOURCE_H diff --git a/src/pybind11-qt/include/pybind11_qt/details/pybind11_qt_sip.h b/src/pybind11-qt/include/pybind11_qt/details/pybind11_qt_sip.h index be2e882..2996c4b 100644 --- a/src/pybind11-qt/include/pybind11_qt/details/pybind11_qt_sip.h +++ b/src/pybind11-qt/include/pybind11_qt/details/pybind11_qt_sip.h @@ -25,8 +25,7 @@ namespace pybind11::detail::qt { template struct MetaData>> - : MetaData> { - }; + : MetaData> {}; // template class for most Qt types that have Python equivalent (QWidget, // etc.) diff --git a/src/pybind11-qt/include/pybind11_qt/pybind11_qt_containers.h b/src/pybind11-qt/include/pybind11_qt/pybind11_qt_containers.h index 4c916e6..120b5e8 100644 --- a/src/pybind11-qt/include/pybind11_qt/pybind11_qt_containers.h +++ b/src/pybind11-qt/include/pybind11_qt/pybind11_qt_containers.h @@ -9,41 +9,36 @@ #include // this needs to be included here to get proper QVariantList and QVariantMap +#include "details/pybind11_qt_qlist.h" #include "details/pybind11_qt_qmap.h" #include "pybind11_qt_basic.h" -#include "details/pybind11_qt_qlist.h" namespace pybind11::detail { // QList // template - struct type_caster> : qt::qlist_caster, T> { - }; + struct type_caster> : qt::qlist_caster, T> {}; // QSet // template - struct type_caster> : set_caster, T> { - }; + struct type_caster> : set_caster, T> {}; // QMap // template - struct type_caster> : qt::qmap_caster, K, V> { - }; + struct type_caster> : qt::qmap_caster, K, V> {}; // QStringList // template <> - struct type_caster : qt::qlist_caster { - }; + struct type_caster : qt::qlist_caster {}; // QVariantList // template <> - struct type_caster : qt::qlist_caster { - }; + struct type_caster : qt::qlist_caster {}; // QVariantMap // diff --git a/src/pybind11-qt/include/pybind11_qt/pybind11_qt_enums.h b/src/pybind11-qt/include/pybind11_qt/pybind11_qt_enums.h index ae98cd5..b58cc41 100644 --- a/src/pybind11-qt/include/pybind11_qt/pybind11_qt_enums.h +++ b/src/pybind11-qt/include/pybind11_qt/pybind11_qt_enums.h @@ -18,8 +18,7 @@ }; \ } \ template <> \ - struct type_caster : qt::qt_enum_caster { \ - }; \ + struct type_caster : qt::qt_enum_caster {}; \ } PYQT_ENUM(QtCore, Qt::AlignmentFlag); diff --git a/src/pybind11-qt/include/pybind11_qt/pybind11_qt_objects.h b/src/pybind11-qt/include/pybind11_qt/pybind11_qt_objects.h index 1a9517d..ad5aa1e 100644 --- a/src/pybind11-qt/include/pybind11_qt/pybind11_qt_objects.h +++ b/src/pybind11-qt/include/pybind11_qt/pybind11_qt_objects.h @@ -30,13 +30,11 @@ template <> \ struct type_caster \ : std::conditional_t, \ - type_caster_generic, qt::qt_type_caster> { \ - }; \ + type_caster_generic, qt::qt_type_caster> {}; \ template <> \ struct type_caster \ : std::conditional_t, \ - qt::qt_type_caster, type_caster> { \ - }; \ + qt::qt_type_caster, type_caster> {}; \ } // add declarations below to create bindings - the first argument is simply diff --git a/src/pybind11-utils/include/pybind11_utils/functional.h b/src/pybind11-utils/include/pybind11_utils/functional.h index 67c599e..8662d82 100644 --- a/src/pybind11-utils/include/pybind11_utils/functional.h +++ b/src/pybind11-utils/include/pybind11_utils/functional.h @@ -97,10 +97,7 @@ namespace pybind11::detail { : f(std::move(f_)) { } - func_handle(const func_handle& f_) - { - operator=(f_); - } + func_handle(const func_handle& f_) { operator=(f_); } func_handle& operator=(const func_handle& f_) { gil_scoped_acquire acq; diff --git a/src/pybind11-utils/include/pybind11_utils/shared_cpp_owner.h b/src/pybind11-utils/include/pybind11_utils/shared_cpp_owner.h index 0fb0fe6..4eac89e 100644 --- a/src/pybind11-utils/include/pybind11_utils/shared_cpp_owner.h +++ b/src/pybind11-utils/include/pybind11_utils/shared_cpp_owner.h @@ -80,13 +80,11 @@ namespace mo2::python::detail { template <> \ struct type_caster> \ : mo2::python::detail::shared_cpp_owner_caster> { \ - }; \ + std::shared_ptr> {}; \ template <> \ struct type_caster> \ : mo2::python::detail::shared_cpp_owner_caster< \ - Type, std::shared_ptr> { \ - }; \ + Type, std::shared_ptr> {}; \ } #endif diff --git a/src/pybind11-utils/include/pybind11_utils/smart_variant_wrapper.h b/src/pybind11-utils/include/pybind11_utils/smart_variant_wrapper.h index 8bc5e6d..c5dd815 100644 --- a/src/pybind11-utils/include/pybind11_utils/smart_variant_wrapper.h +++ b/src/pybind11-utils/include/pybind11_utils/smart_variant_wrapper.h @@ -173,8 +173,7 @@ namespace pybind11::detail { template struct type_caster<::mo2::python::smart_variant> - : variant_caster<::mo2::python::smart_variant> { - }; + : variant_caster<::mo2::python::smart_variant> {}; } // namespace pybind11::detail