Skip to content

Commit

Permalink
chore(deps): update pre-commit hooks (#4838)
Browse files Browse the repository at this point in the history
* chore(deps): update pre-commit hooks

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.281 → v0.0.287](astral-sh/ruff-pre-commit@v0.0.281...v0.0.287)
- [github.com/pre-commit/mirrors-mypy: v1.4.1 → v1.5.1](pre-commit/mirrors-mypy@v1.4.1...v1.5.1)
- [github.com/asottile/blacken-docs: 1.15.0 → 1.16.0](adamchainz/blacken-docs@1.15.0...1.16.0)
- [github.com/Lucas-C/pre-commit-hooks: v1.5.1 → v1.5.4](Lucas-C/pre-commit-hooks@v1.5.1...v1.5.4)
- [github.com/PyCQA/pylint: v3.0.0a6 → v3.0.0a7](pylint-dev/pylint@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 <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and henryiii authored Sep 6, 2023
1 parent c9638a1 commit 467fe27
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ repos:

# Ruff, the Python auto-correcting linter written in Rust
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.281
rev: v0.0.287
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]

# Check static types with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.4.1"
rev: "v1.5.1"
hooks:
- id: mypy
args: []
Expand Down Expand Up @@ -84,15 +84,15 @@ repos:

# Also code format the docs
- repo: https://github.com/asottile/blacken-docs
rev: "1.15.0"
rev: "1.16.0"
hooks:
- id: blacken-docs
additional_dependencies:
- black==23.3.0 # keep in sync with black hook

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: "v1.5.1"
rev: "v1.5.4"
hooks:
- id: remove-tabs

Expand Down Expand Up @@ -147,7 +147,7 @@ repos:

# PyLint has native support - not always usable, but works for us
- repo: https://github.com/PyCQA/pylint
rev: "v3.0.0a6"
rev: "v3.0.0a7"
hooks:
- id: pylint
files: ^pybind11
2 changes: 1 addition & 1 deletion docs/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def generate_dummy_code_boost(nclasses=10):

for codegen in [generate_dummy_code_pybind11, generate_dummy_code_boost]:
print("{")
for i in range(0, 10):
for i in range(10):
nclasses = 2**i
with open("test.cpp", "w") as f:
f.write(codegen(nclasses))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,5 @@ line-length = 120
isort.known-first-party = ["env", "pybind11_cross_module_tests", "pybind11_tests"]

[tool.ruff.per-file-ignores]
"tests/**" = ["EM", "N"]
"tests/**" = ["EM", "N", "E721"]
"tests/test_call_policies.py" = ["PLC1901"]
6 changes: 3 additions & 3 deletions tests/test_stl_binders.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ def test_map_string_double_const():
def test_noncopyable_containers():
# std::vector
vnc = m.get_vnc(5)
for i in range(0, 5):
for i in range(5):
assert vnc[i].value == i + 1

for i, j in enumerate(vnc, start=1):
assert j.value == i

# std::deque
dnc = m.get_dnc(5)
for i in range(0, 5):
for i in range(5):
assert dnc[i].value == i + 1

i = 1
Expand Down Expand Up @@ -252,7 +252,7 @@ def test_noncopyable_containers():
# nested std::map<std::vector>
nvnc = m.get_nvnc(5)
for i in range(1, 6):
for j in range(0, 5):
for j in range(5):
assert nvnc[i][j].value == j + 1

# Note: maps do not have .values()
Expand Down

0 comments on commit 467fe27

Please sign in to comment.