Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#855)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit: v3.7.0 → v3.8.0](pre-commit/pre-commit@v3.7.0...v3.8.0)
- [github.com/PyCQA/pylint: v3.1.0 → v3.2.6](pylint-dev/pylint@v3.1.0...v3.2.6)
- [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](PyCQA/flake8@7.0.0...7.1.0)
- [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.11.0](pre-commit/mirrors-mypy@v1.10.0...v1.11.0)
- [github.com/asottile/pyupgrade: v3.15.2 → v3.17.0](asottile/pyupgrade@v3.15.2...v3.17.0)
- [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](codespell-project/codespell@v2.2.6...v2.3.0)

* fixup tests

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Marco Gorelli <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and MarcoGorelli authored Aug 5, 2024
1 parent 3bce0b5 commit 99609c7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
- id: trailing-whitespace
- id: debug-statements
- repo: https://github.com/pre-commit/pre-commit
rev: v3.7.0
rev: v3.8.0
hooks:
- id: validate_manifest
- repo: https://github.com/hauntsaninja/black-pre-commit-mirror
Expand All @@ -17,13 +17,13 @@ repos:
hooks:
- id: black
- repo: https://github.com/PyCQA/pylint
rev: v3.1.0
rev: v3.2.6
hooks:
- id: pylint
files: ^(nbqa|tests)/
exclude: ^tests/data/
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies: [flake8-typing-imports==1.14.0]
Expand All @@ -38,13 +38,13 @@ repos:
- id: pydocstyle
files: ^nbqa/
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.11.0
hooks:
- id: mypy
exclude: ^docs/
additional_dependencies: [types-setuptools, types-toml]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand All @@ -53,7 +53,7 @@ repos:
hooks:
- id: auto-walrus
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
files: \.(py|rst|md)$
Expand Down
1 change: 1 addition & 0 deletions tests/tools/test_pylint_works.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def test_pylint_works(capsys: "CaptureFixture") -> None:
f'{notebook1}:cell_4:1:0: C0413: Import "from random import randint" should be placed at the top of the module (wrong-import-position)\n' # noqa: E501
f'{notebook1}:cell_5:1:0: C0413: Import "import pprint" should be placed at the top of the module (wrong-import-position)\n' # noqa: E501
f'{notebook1}:cell_5:2:0: C0413: Import "import sys" should be placed at the top of the module (wrong-import-position)\n' # noqa: E501
f"{notebook1}:cell_5:9:0: E0606: Possibly using variable 'pretty_print_object' before assignment (possibly-used-before-assignment)\n" # noqa: E501
f'{notebook1}:cell_4:1:0: C0411: standard import "random.randint" should be placed before first party import "nbqa" (wrong-import-order)\n' # noqa: E501
f'{notebook1}:cell_5:1:0: C0411: standard import "pprint" should be placed before first party import "nbqa" (wrong-import-order)\n' # noqa: E501
f'{notebook1}:cell_5:2:0: C0411: standard import "sys" should be placed before first party import "nbqa" (wrong-import-order)\n' # noqa: E501
Expand Down
12 changes: 6 additions & 6 deletions tests/tools/test_ruff_works.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ def test_ruff_works(
expected_path_2 = os.path.join("tests", "data", "notebook_starting_with_md.ipynb")

out, err = capsys.readouterr()
# ignore ruff's suggestions
out = "\n".join([x for x in out.splitlines() if "cell_" in x])
expected_out = (
"Found 13 errors.\n"
"[*] 10 fixable with the `--fix` option.\n"
f"{expected_path_1}:cell_1:1:8: F401 [*] `os` imported but unused\n"
f"{expected_path_1}:cell_1:3:8: F401 [*] `glob` imported but unused\n"
f"{expected_path_1}:cell_1:5:8: F401 [*] `nbqa` imported but unused\n"
f"{expected_path_0}:cell_1:1:8: F401 [*] `os` imported but unused\n"
f"{expected_path_0}:cell_1:3:8: F401 [*] `glob` imported but unused\n"
f"{expected_path_0}:cell_1:5:8: F401 [*] `nbqa` imported but unused\n"
f"{expected_path_0}:cell_4:1:1: E402 Module level import not at top of file\n"
f"{expected_path_0}:cell_4:1:20: F401 [*] `random.randint` imported but unused\n"
f"{expected_path_0}:cell_5:1:1: E402 Module level import not at top of file\n"
f"{expected_path_0}:cell_5:2:1: E402 Module level import not at top of file\n"
f"{expected_path_1}:cell_1:1:8: F401 [*] `os` imported but unused\n"
f"{expected_path_1}:cell_1:3:8: F401 [*] `glob` imported but unused\n"
f"{expected_path_1}:cell_1:5:8: F401 [*] `nbqa` imported but unused\n"
f"{expected_path_2}:cell_1:1:8: F401 [*] `os` imported but unused\n"
f"{expected_path_2}:cell_1:3:8: F401 [*] `glob` imported but unused\n"
f"{expected_path_2}:cell_1:5:8: F401 [*] `nbqa` imported but unused"
f"{expected_path_2}:cell_1:5:8: F401 [*] `nbqa` imported but unused\n"
)
assert "\n".join(sorted(out.replace("\r\n", "\n").splitlines())) == "\n".join(
sorted(expected_out.splitlines())
Expand Down

0 comments on commit 99609c7

Please sign in to comment.