Skip to content

Commit 14a1aec

Browse files
committed
chore: update hooks and Ruff config
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent fa27d2f commit 14a1aec

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ repos:
2525

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

3333
# Black, the code formatter, natively supports pre-commit
3434
- repo: https://github.com/psf/black-pre-commit-mirror
35-
rev: "23.9.1" # Keep in sync with blacken-docs
35+
rev: "23.10.1" # Keep in sync with blacken-docs
3636
hooks:
3737
- id: black
3838

3939
# Ruff, the Python auto-correcting linter written in Rust
4040
- repo: https://github.com/astral-sh/ruff-pre-commit
41-
rev: v0.0.292
41+
rev: v0.1.2
4242
hooks:
4343
- id: ruff
4444
args: ["--fix", "--show-fixes"]
4545

4646
# Check static types with mypy
4747
- repo: https://github.com/pre-commit/mirrors-mypy
48-
rev: "v1.5.1"
48+
rev: "v1.6.1"
4949
hooks:
5050
- id: mypy
5151
args: []
@@ -67,7 +67,7 @@ repos:
6767

6868
# Standard hooks
6969
- repo: https://github.com/pre-commit/pre-commit-hooks
70-
rev: "v4.4.0"
70+
rev: "v4.5.0"
7171
hooks:
7272
- id: check-added-large-files
7373
- id: check-case-conflict
@@ -98,7 +98,7 @@ repos:
9898

9999
# Avoid directional quotes
100100
- repo: https://github.com/sirosen/texthooks
101-
rev: "0.5.0"
101+
rev: "0.6.2"
102102
hooks:
103103
- id: fix-ligatures
104104
- id: fix-smartquotes
@@ -147,7 +147,7 @@ repos:
147147

148148
# PyLint has native support - not always usable, but works for us
149149
- repo: https://github.com/PyCQA/pylint
150-
rev: "v3.0.0"
150+
rev: "v3.0.1"
151151
hooks:
152152
- id: pylint
153153
files: ^pybind11

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ignore = [
1919

2020
[tool.mypy]
2121
files = ["pybind11"]
22-
python_version = "3.6"
22+
python_version = "3.7"
2323
strict = true
2424
show_error_codes = true
2525
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
@@ -57,10 +57,13 @@ messages_control.disable = [
5757
"unused-argument", # covered by Ruff ARG
5858
]
5959

60-
6160
[tool.ruff]
62-
select = [
63-
"E", "F", "W", # flake8
61+
target-version = "py37"
62+
src = ["src"]
63+
line-length = 120
64+
65+
[tool.ruff.lint]
66+
extend-select = [
6467
"B", # flake8-bugbear
6568
"I", # isort
6669
"N", # pep8-naming
@@ -86,13 +89,10 @@ ignore = [
8689
"PT004", # Fixture that doesn't return needs underscore (no, it is fine)
8790
"SIM118", # iter(x) is not always the same as iter(x.keys())
8891
]
89-
target-version = "py37"
90-
src = ["src"]
9192
unfixable = ["T20"]
9293
exclude = []
93-
line-length = 120
9494
isort.known-first-party = ["env", "pybind11_cross_module_tests", "pybind11_tests"]
9595

96-
[tool.ruff.per-file-ignores]
96+
[tool.ruff.lint.per-file-ignores]
9797
"tests/**" = ["EM", "N", "E721"]
9898
"tests/test_call_policies.py" = ["PLC1901"]

tests/test_numpy_dtypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ py::array mkarray_via_buffer(size_t n) {
157157
do { \
158158
(s).bool_ = (i) % 2 != 0; \
159159
(s).uint_ = (uint32_t) (i); \
160-
(s).float_ = (float) (i) *1.5f; \
160+
(s).float_ = (float) (i) * 1.5f; \
161161
(s).ldbl_ = (long double) (i) * -2.5L; \
162162
} while (0)
163163

tests/test_pytypes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,8 @@ TEST_SUBMODULE(pytypes, m) {
662662
// This is "most correct" and enforced on these platforms.
663663
# define PYBIND11_AUTO_IT auto it
664664
#else
665-
// This works on many platforms and is (unfortunately) reflective of existing user code.
666-
// NOLINTNEXTLINE(bugprone-macro-parentheses)
665+
// This works on many platforms and is (unfortunately) reflective of existing user code.
666+
// NOLINTNEXTLINE(bugprone-macro-parentheses)
667667
# define PYBIND11_AUTO_IT auto &it
668668
#endif
669669

0 commit comments

Comments
 (0)