Skip to content

[pre-commit] Add pyupgrade back as a manual stage #12418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ repos:
- id: pyproject-fmt
# https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version
additional_dependencies: ["tox>=4.9"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
stages: [manual]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously added pylint this way so can be launched similarly with pre-commit run --hook-stage manual pylint -a :)

- repo: local
hooks:
- id: pylint
Expand Down
4 changes: 2 additions & 2 deletions testing/test_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def test_hello(self):
@pytest.mark.parametrize("type", ["Error", "Failure"])
def test_testcase_custom_exception_info(pytester: Pytester, type: str) -> None:
pytester.makepyfile(
"""
f"""
from typing import Generic, TypeVar
from unittest import TestCase
import pytest, _pytest._code
Expand Down Expand Up @@ -413,7 +413,7 @@ def from_exc_info(cls, *args, **kwargs):

def test_hello(self):
pass
""".format(**locals())
"""
)
result = pytester.runpytest()
result.stdout.fnmatch_lines(
Expand Down
Loading