chore(deps): update pre-commit hooks (#4838)

* chore(deps): update pre-commit hooks

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.281 → v0.0.287](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.281...v0.0.287)
- [github.com/pre-commit/mirrors-mypy: v1.4.1 → v1.5.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.4.1...v1.5.1)
- [github.com/asottile/blacken-docs: 1.15.0 → 1.16.0](https://github.com/asottile/blacken-docs/compare/1.15.0...1.16.0)
- [github.com/Lucas-C/pre-commit-hooks: v1.5.1 → v1.5.4](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.5.1...v1.5.4)
- [github.com/PyCQA/pylint: v3.0.0a6 → v3.0.0a7](https://github.com/PyCQA/pylint/compare/v3.0.0a6...v3.0.0a7)

* style: pre-commit fixes

* Update pyproject.toml

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
This commit is contained in:
pre-commit-ci[bot] 2023-09-06 06:04:27 -07:00 committed by GitHub
parent c9638a1927
commit 467fe27bd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View File

@ -38,14 +38,14 @@ repos:
# Ruff, the Python auto-correcting linter written in Rust # Ruff, the Python auto-correcting linter written in Rust
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.281 rev: v0.0.287
hooks: hooks:
- id: ruff - id: ruff
args: ["--fix", "--show-fixes"] args: ["--fix", "--show-fixes"]
# Check static types with mypy # Check static types with mypy
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.4.1" rev: "v1.5.1"
hooks: hooks:
- id: mypy - id: mypy
args: [] args: []
@ -84,7 +84,7 @@ repos:
# Also code format the docs # Also code format the docs
- repo: https://github.com/asottile/blacken-docs - repo: https://github.com/asottile/blacken-docs
rev: "1.15.0" rev: "1.16.0"
hooks: hooks:
- id: blacken-docs - id: blacken-docs
additional_dependencies: additional_dependencies:
@ -92,7 +92,7 @@ repos:
# Changes tabs to spaces # Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks - repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.1" rev: "v1.5.4"
hooks: hooks:
- id: remove-tabs - id: remove-tabs
@ -147,7 +147,7 @@ repos:
# PyLint has native support - not always usable, but works for us # PyLint has native support - not always usable, but works for us
- repo: https://github.com/PyCQA/pylint - repo: https://github.com/PyCQA/pylint
rev: "v3.0.0a6" rev: "v3.0.0a7"
hooks: hooks:
- id: pylint - id: pylint
files: ^pybind11 files: ^pybind11

View File

@ -70,7 +70,7 @@ def generate_dummy_code_boost(nclasses=10):
for codegen in [generate_dummy_code_pybind11, generate_dummy_code_boost]: for codegen in [generate_dummy_code_pybind11, generate_dummy_code_boost]:
print("{") print("{")
for i in range(0, 10): for i in range(10):
nclasses = 2**i nclasses = 2**i
with open("test.cpp", "w") as f: with open("test.cpp", "w") as f:
f.write(codegen(nclasses)) f.write(codegen(nclasses))

View File

@ -94,5 +94,5 @@ line-length = 120
isort.known-first-party = ["env", "pybind11_cross_module_tests", "pybind11_tests"] isort.known-first-party = ["env", "pybind11_cross_module_tests", "pybind11_tests"]
[tool.ruff.per-file-ignores] [tool.ruff.per-file-ignores]
"tests/**" = ["EM", "N"] "tests/**" = ["EM", "N", "E721"]
"tests/test_call_policies.py" = ["PLC1901"] "tests/test_call_policies.py" = ["PLC1901"]

View File

@ -209,7 +209,7 @@ def test_map_string_double_const():
def test_noncopyable_containers(): def test_noncopyable_containers():
# std::vector # std::vector
vnc = m.get_vnc(5) vnc = m.get_vnc(5)
for i in range(0, 5): for i in range(5):
assert vnc[i].value == i + 1 assert vnc[i].value == i + 1
for i, j in enumerate(vnc, start=1): for i, j in enumerate(vnc, start=1):
@ -217,7 +217,7 @@ def test_noncopyable_containers():
# std::deque # std::deque
dnc = m.get_dnc(5) dnc = m.get_dnc(5)
for i in range(0, 5): for i in range(5):
assert dnc[i].value == i + 1 assert dnc[i].value == i + 1
i = 1 i = 1
@ -252,7 +252,7 @@ def test_noncopyable_containers():
# nested std::map<std::vector> # nested std::map<std::vector>
nvnc = m.get_nvnc(5) nvnc = m.get_nvnc(5)
for i in range(1, 6): for i in range(1, 6):
for j in range(0, 5): for j in range(5):
assert nvnc[i][j].value == j + 1 assert nvnc[i][j].value == j + 1
# Note: maps do not have .values() # Note: maps do not have .values()