Skip to content

Commit 4768a6f

Browse files
chore(deps): update pre-commit hooks (#4386)
* chore(deps): update pre-commit hooks updates: - [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](pre-commit/pre-commit-hooks@v4.3.0...v4.4.0) - [github.com/asottile/pyupgrade: v3.2.0 → v3.3.0](asottile/pyupgrade@v3.2.0...v3.3.0) - [github.com/hadialqattan/pycln: v2.1.1 → v2.1.2](hadialqattan/pycln@v2.1.1...v2.1.2) - [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](PyCQA/flake8@5.0.4...6.0.0) - [github.com/PyCQA/pylint: v2.15.5 → v2.15.8](pylint-dev/pylint@v2.15.5...v2.15.8) - [github.com/pre-commit/mirrors-mypy: v0.982 → v0.991](pre-commit/mirrors-mypy@v0.982...v0.991) - [github.com/mgedmin/check-manifest: 0.48 → 0.49](mgedmin/check-manifest@0.48...0.49) - [github.com/pre-commit/mirrors-clang-format: v14.0.6 → v15.0.4](pre-commit/mirrors-clang-format@v14.0.6...v15.0.4) * style: pre-commit fixes Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a672de7 commit 4768a6f

File tree

8 files changed

+36
-30
lines changed

8 files changed

+36
-30
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ exclude: ^tools/JoinPaths.cmake$
2424
repos:
2525
# Standard hooks
2626
- repo: https://github.com/pre-commit/pre-commit-hooks
27-
rev: "v4.3.0"
27+
rev: "v4.4.0"
2828
hooks:
2929
- id: check-added-large-files
3030
- id: check-case-conflict
@@ -41,7 +41,7 @@ repos:
4141

4242
# Upgrade old Python syntax
4343
- repo: https://github.com/asottile/pyupgrade
44-
rev: "v3.2.0"
44+
rev: "v3.3.0"
4545
hooks:
4646
- id: pyupgrade
4747
args: [--py36-plus]
@@ -80,7 +80,7 @@ repos:
8080

8181
# Autoremoves unused imports
8282
- repo: https://github.com/hadialqattan/pycln
83-
rev: "v2.1.1"
83+
rev: "v2.1.2"
8484
hooks:
8585
- id: pycln
8686
stages: [manual]
@@ -108,15 +108,15 @@ repos:
108108

109109
# Flake8 also supports pre-commit natively (same author)
110110
- repo: https://github.com/PyCQA/flake8
111-
rev: "5.0.4"
111+
rev: "6.0.0"
112112
hooks:
113113
- id: flake8
114114
exclude: ^(docs/.*|tools/.*)$
115115
additional_dependencies: *flake8_dependencies
116116

117117
# PyLint has native support - not always usable, but works for us
118118
- repo: https://github.com/PyCQA/pylint
119-
rev: "v2.15.5"
119+
rev: "v2.15.8"
120120
hooks:
121121
- id: pylint
122122
files: ^pybind11
@@ -132,7 +132,7 @@ repos:
132132

133133
# Check static types with mypy
134134
- repo: https://github.com/pre-commit/mirrors-mypy
135-
rev: "v0.982"
135+
rev: "v0.991"
136136
hooks:
137137
- id: mypy
138138
args: []
@@ -141,7 +141,7 @@ repos:
141141

142142
# Checks the manifest for missing files (native support)
143143
- repo: https://github.com/mgedmin/check-manifest
144-
rev: "0.48"
144+
rev: "0.49"
145145
hooks:
146146
- id: check-manifest
147147
# This is a slow hook, so only run this if --hook-stage manual is passed
@@ -175,7 +175,7 @@ repos:
175175

176176
# Clang format the codebase automatically
177177
- repo: https://github.com/pre-commit/mirrors-clang-format
178-
rev: "v14.0.6"
178+
rev: "v15.0.4"
179179
hooks:
180180
- id: clang-format
181181
types_or: [c++, c, cuda]

include/pybind11/cast.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ public:
9191
template <typename T_, \
9292
::pybind11::detail::enable_if_t< \
9393
std::is_same<type, ::pybind11::detail::remove_cv_t<T_>>::value, \
94-
int> = 0> \
94+
int> \
95+
= 0> \
9596
static ::pybind11::handle cast( \
9697
T_ *src, ::pybind11::return_value_policy policy, ::pybind11::handle parent) { \
9798
if (!src) \

include/pybind11/detail/common.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@
3434
# define PYBIND11_WARNING_POP PYBIND11_PRAGMA(warning(pop))
3535
#elif defined(__INTEL_COMPILER)
3636
# define PYBIND11_COMPILER_INTEL
37-
# define PYBIND11_PRAGMA(...) _Pragma(# __VA_ARGS__)
37+
# define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)
3838
# define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(warning push)
3939
# define PYBIND11_WARNING_POP PYBIND11_PRAGMA(warning pop)
4040
#elif defined(__clang__)
4141
# define PYBIND11_COMPILER_CLANG
42-
# define PYBIND11_PRAGMA(...) _Pragma(# __VA_ARGS__)
42+
# define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)
4343
# define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(clang diagnostic push)
4444
# define PYBIND11_WARNING_POP PYBIND11_PRAGMA(clang diagnostic push)
4545
#elif defined(__GNUC__)
4646
# define PYBIND11_COMPILER_GCC
47-
# define PYBIND11_PRAGMA(...) _Pragma(# __VA_ARGS__)
47+
# define PYBIND11_PRAGMA(...) _Pragma(#__VA_ARGS__)
4848
# define PYBIND11_WARNING_PUSH PYBIND11_PRAGMA(GCC diagnostic push)
4949
# define PYBIND11_WARNING_POP PYBIND11_PRAGMA(GCC diagnostic pop)
5050
#endif

include/pybind11/detail/init.h

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,11 @@ struct constructor {
209209
extra...);
210210
}
211211

212-
template <typename Class,
213-
typename... Extra,
214-
enable_if_t<Class::has_alias && std::is_constructible<Cpp<Class>, Args...>::value,
215-
int> = 0>
212+
template <
213+
typename Class,
214+
typename... Extra,
215+
enable_if_t<Class::has_alias && std::is_constructible<Cpp<Class>, Args...>::value, int>
216+
= 0>
216217
static void execute(Class &cl, const Extra &...extra) {
217218
cl.def(
218219
"__init__",
@@ -229,10 +230,11 @@ struct constructor {
229230
extra...);
230231
}
231232

232-
template <typename Class,
233-
typename... Extra,
234-
enable_if_t<Class::has_alias && !std::is_constructible<Cpp<Class>, Args...>::value,
235-
int> = 0>
233+
template <
234+
typename Class,
235+
typename... Extra,
236+
enable_if_t<Class::has_alias && !std::is_constructible<Cpp<Class>, Args...>::value, int>
237+
= 0>
236238
static void execute(Class &cl, const Extra &...extra) {
237239
cl.def(
238240
"__init__",
@@ -248,10 +250,11 @@ struct constructor {
248250
// Implementing class for py::init_alias<...>()
249251
template <typename... Args>
250252
struct alias_constructor {
251-
template <typename Class,
252-
typename... Extra,
253-
enable_if_t<Class::has_alias && std::is_constructible<Alias<Class>, Args...>::value,
254-
int> = 0>
253+
template <
254+
typename Class,
255+
typename... Extra,
256+
enable_if_t<Class::has_alias && std::is_constructible<Alias<Class>, Args...>::value, int>
257+
= 0>
255258
static void execute(Class &cl, const Extra &...extra) {
256259
cl.def(
257260
"__init__",

include/pybind11/numpy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,7 @@ struct npy_format_descriptor {
14711471
}
14721472

14731473
// Extract name, offset and format descriptor for a struct field
1474-
# define PYBIND11_FIELD_DESCRIPTOR(T, Field) PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, # Field)
1474+
# define PYBIND11_FIELD_DESCRIPTOR(T, Field) PYBIND11_FIELD_DESCRIPTOR_EX(T, Field, #Field)
14751475

14761476
// The main idea of this macro is borrowed from https://github.com/swansontec/map-macro
14771477
// (C) William Swanson, Paul Fultz

include/pybind11/pybind11.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,9 +1426,9 @@ template <typename T, enable_if_t<has_operator_delete<T>::value, int> = 0>
14261426
void call_operator_delete(T *p, size_t, size_t) {
14271427
T::operator delete(p);
14281428
}
1429-
template <
1430-
typename T,
1431-
enable_if_t<!has_operator_delete<T>::value && has_operator_delete_size<T>::value, int> = 0>
1429+
template <typename T,
1430+
enable_if_t<!has_operator_delete<T>::value && has_operator_delete_size<T>::value, int>
1431+
= 0>
14321432
void call_operator_delete(T *p, size_t s, size_t) {
14331433
T::operator delete(p, s);
14341434
}

include/pybind11/pytypes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ class handle : public detail::object_api<handle> {
232232
detail::enable_if_t<detail::all_of<detail::none_of<std::is_base_of<handle, T>,
233233
detail::is_pyobj_ptr_or_nullptr_t<T>>,
234234
std::is_convertible<T, PyObject *>>::value,
235-
int> = 0>
235+
int>
236+
= 0>
236237
// NOLINTNEXTLINE(google-explicit-constructor)
237238
handle(T &obj) : m_ptr(obj) {}
238239

tests/test_virtual_functions.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ struct AdderBase {
173173
using DataVisitor = std::function<void(const Data &)>;
174174

175175
virtual void
176-
operator()(const Data &first, const Data &second, const DataVisitor &visitor) const = 0;
176+
operator()(const Data &first, const Data &second, const DataVisitor &visitor) const
177+
= 0;
177178
virtual ~AdderBase() = default;
178179
AdderBase() = default;
179180
AdderBase(const AdderBase &) = delete;

0 commit comments

Comments
 (0)