Skip to content

Commit 5c07fee

Browse files
chore(deps): update pre-commit hooks (#5432)
* chore(deps): update pre-commit hooks updates: - [github.com/pre-commit/mirrors-clang-format: v18.1.8 → v19.1.3](pre-commit/mirrors-clang-format@v18.1.8...v19.1.3) - [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.7.2](astral-sh/ruff-pre-commit@v0.6.3...v0.7.2) - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.13.0](pre-commit/mirrors-mypy@v1.11.2...v1.13.0) - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.6.0...v5.0.0) - [github.com/adamchainz/blacken-docs: 1.18.0 → 1.19.1](adamchainz/blacken-docs@1.18.0...1.19.1) - [github.com/mgedmin/check-manifest: 0.49 → 0.50](mgedmin/check-manifest@0.49...0.50) - [github.com/PyCQA/pylint: v3.2.7 → v3.3.1](pylint-dev/pylint@v3.2.7...v3.3.1) - [github.com/python-jsonschema/check-jsonschema: 0.29.2 → 0.29.4](python-jsonschema/check-jsonschema@0.29.2...0.29.4) * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent bc041de commit 5c07fee

File tree

6 files changed

+23
-24
lines changed

6 files changed

+23
-24
lines changed

Diff for: .pre-commit-config.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ repos:
2525

2626
# Clang format the codebase automatically
2727
- repo: https://github.com/pre-commit/mirrors-clang-format
28-
rev: "v18.1.8"
28+
rev: "v19.1.3"
2929
hooks:
3030
- id: clang-format
3131
types_or: [c++, c, cuda]
3232

3333
# Ruff, the Python auto-correcting linter/formatter written in Rust
3434
- repo: https://github.com/astral-sh/ruff-pre-commit
35-
rev: v0.6.3
35+
rev: v0.7.2
3636
hooks:
3737
- id: ruff
3838
args: ["--fix", "--show-fixes"]
3939
- id: ruff-format
4040

4141
# Check static types with mypy
4242
- repo: https://github.com/pre-commit/mirrors-mypy
43-
rev: "v1.11.2"
43+
rev: "v1.13.0"
4444
hooks:
4545
- id: mypy
4646
args: []
@@ -62,7 +62,7 @@ repos:
6262

6363
# Standard hooks
6464
- repo: https://github.com/pre-commit/pre-commit-hooks
65-
rev: "v4.6.0"
65+
rev: "v5.0.0"
6666
hooks:
6767
- id: check-added-large-files
6868
- id: check-case-conflict
@@ -79,7 +79,7 @@ repos:
7979

8080
# Also code format the docs
8181
- repo: https://github.com/adamchainz/blacken-docs
82-
rev: "1.18.0"
82+
rev: "1.19.1"
8383
hooks:
8484
- id: blacken-docs
8585
additional_dependencies:
@@ -108,7 +108,7 @@ repos:
108108

109109
# Checks the manifest for missing files (native support)
110110
- repo: https://github.com/mgedmin/check-manifest
111-
rev: "0.49"
111+
rev: "0.50"
112112
hooks:
113113
- id: check-manifest
114114
# This is a slow hook, so only run this if --hook-stage manual is passed
@@ -142,14 +142,14 @@ repos:
142142

143143
# PyLint has native support - not always usable, but works for us
144144
- repo: https://github.com/PyCQA/pylint
145-
rev: "v3.2.7"
145+
rev: "v3.3.1"
146146
hooks:
147147
- id: pylint
148148
files: ^pybind11
149149

150150
# Check schemas on some of our YAML files
151151
- repo: https://github.com/python-jsonschema/check-jsonschema
152-
rev: 0.29.2
152+
rev: 0.29.4
153153
hooks:
154154
- id: check-readthedocs
155155
- id: check-github-workflows

Diff for: include/pybind11/detail/common.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1145,14 +1145,14 @@ struct overload_cast_impl {
11451145
}
11461146

11471147
template <typename Return, typename Class>
1148-
constexpr auto operator()(Return (Class::*pmf)(Args...),
1149-
std::false_type = {}) const noexcept -> decltype(pmf) {
1148+
constexpr auto operator()(Return (Class::*pmf)(Args...), std::false_type = {}) const noexcept
1149+
-> decltype(pmf) {
11501150
return pmf;
11511151
}
11521152

11531153
template <typename Return, typename Class>
1154-
constexpr auto operator()(Return (Class::*pmf)(Args...) const,
1155-
std::true_type) const noexcept -> decltype(pmf) {
1154+
constexpr auto operator()(Return (Class::*pmf)(Args...) const, std::true_type) const noexcept
1155+
-> decltype(pmf) {
11561156
return pmf;
11571157
}
11581158
};

Diff for: include/pybind11/detail/descr.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,8 @@ constexpr auto concat(const descr<N, Ts...> &d, const Args &...args) {
156156
}
157157
#else
158158
template <size_t N, typename... Ts, typename... Args>
159-
constexpr auto concat(const descr<N, Ts...> &d,
160-
const Args &...args) -> decltype(std::declval<descr<N + 2, Ts...>>()
161-
+ concat(args...)) {
159+
constexpr auto concat(const descr<N, Ts...> &d, const Args &...args)
160+
-> decltype(std::declval<descr<N + 2, Ts...>>() + concat(args...)) {
162161
return d + const_name(", ") + concat(args...);
163162
}
164163
#endif

Diff for: include/pybind11/detail/internals.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,8 @@ inline std::uint64_t mix64(std::uint64_t z) {
671671
}
672672

673673
template <typename F>
674-
inline auto with_instance_map(const void *ptr,
675-
const F &cb) -> decltype(cb(std::declval<instance_map &>())) {
674+
inline auto with_instance_map(const void *ptr, const F &cb)
675+
-> decltype(cb(std::declval<instance_map &>())) {
676676
auto &internals = get_internals();
677677

678678
#ifdef Py_GIL_DISABLED

Diff for: include/pybind11/detail/type_caster_base.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1161,14 +1161,14 @@ class type_caster_base : public type_caster_generic {
11611161
does not have a private operator new implementation. A comma operator is used in the
11621162
decltype argument to apply SFINAE to the public copy/move constructors.*/
11631163
template <typename T, typename = enable_if_t<is_copy_constructible<T>::value>>
1164-
static auto make_copy_constructor(const T *) -> decltype(new T(std::declval<const T>()),
1165-
Constructor{}) {
1164+
static auto make_copy_constructor(const T *)
1165+
-> decltype(new T(std::declval<const T>()), Constructor{}) {
11661166
return [](const void *arg) -> void * { return new T(*reinterpret_cast<const T *>(arg)); };
11671167
}
11681168

11691169
template <typename T, typename = enable_if_t<is_move_constructible<T>::value>>
1170-
static auto make_move_constructor(const T *) -> decltype(new T(std::declval<T &&>()),
1171-
Constructor{}) {
1170+
static auto make_move_constructor(const T *)
1171+
-> decltype(new T(std::declval<T &&>()), Constructor{}) {
11721172
return [](const void *arg) -> void * {
11731173
return new T(std::move(*const_cast<T *>(reinterpret_cast<const T *>(arg))));
11741174
};

Diff for: include/pybind11/eigen/tensor.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ struct eigen_tensor_helper<
124124
template <typename Type, bool ShowDetails, bool NeedsWriteable = false>
125125
struct get_tensor_descriptor {
126126
static constexpr auto details
127-
= const_name<NeedsWriteable>(", flags.writeable", "")
128-
+ const_name<static_cast<int>(Type::Layout) == static_cast<int>(Eigen::RowMajor)>(
129-
", flags.c_contiguous", ", flags.f_contiguous");
127+
= const_name<NeedsWriteable>(", flags.writeable", "") + const_name
128+
< static_cast<int>(Type::Layout)
129+
== static_cast<int>(Eigen::RowMajor) > (", flags.c_contiguous", ", flags.f_contiguous");
130130
static constexpr auto value
131131
= const_name("numpy.ndarray[") + npy_format_descriptor<typename Type::Scalar>::name
132132
+ const_name("[") + eigen_tensor_helper<remove_cv_t<Type>>::dimensions_descriptor

0 commit comments

Comments
 (0)