[pre-commit.ci] pre-commit autoupdate#14175
Conversation
6549b7e to
e7092a9
Compare
|
I think this is good to go, enabling the new ruff message about using context manager can probably constitute a merge request on its own. |
| directory = "misc" | ||
| name = "Miscellaneous internal changes" | ||
| showcontent = true | ||
| type = [ |
There was a problem hiding this comment.
I'd rather move this to a towncrier.toml than have this weird formatting..
There was a problem hiding this comment.
pyproject-fmt gets more and more developer-hostile. i started to drop it from projects as ever since 2.x it messes up more and more things
There was a problem hiding this comment.
Let's freeze it ? Might need to fork it so it's not upgraded automatically by pre-commit
There was a problem hiding this comment.
I never liked it for myself so I'd normally just avoid integrating it in the first place. Though, it's my problem with most of the "opinionated" tools...
There was a problem hiding this comment.
I forked the pyproject-fmt project and pushed the v2.12.1 tag to our fork so we can have auto-formatting without the opinionated changes.
e7092a9 to
30cae01
Compare
c5ae88f to
167ca3f
Compare
167ca3f to
cc6dac9
Compare
9fd6b83 to
c6e3a59
Compare
pyproject.toml
Outdated
| "PLW2901", # for loop variable overwritten by assignment target | ||
| # ruff ignore | ||
| "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` | ||
| "RUF061", # Use context-manager form of `pytest.raises()` |
There was a problem hiding this comment.
Why ignore this globally? I'd only disable it inline in a few places where the other format is being tested.
pyproject.toml
Outdated
| lint.per-file-ignores."src/_pytest/_version.py" = [ | ||
| "I001", | ||
| ] | ||
| lint.per-file-ignores."testing/**/*.py" = [ "RUF060" ] |
There was a problem hiding this comment.
I suppose this also deserves a justification. Dunno what this rule number is...
|
|
||
| def get_file_part_from_node_id(x: str) -> str: | ||
| return x.split("::")[0] | ||
| return x.split("::", maxsplit=1)[0] |
There was a problem hiding this comment.
This isn't a formatting change — do we need a change note mentioning refactoring?
src/_pytest/timing.py
Outdated
| # Creation time of this instant, using time.time(), to measure actual time. | ||
| # Note: using a `lambda` to correctly get the mocked time via `MockTiming`. | ||
| time: float = dataclasses.field(default_factory=lambda: time(), init=False) | ||
| time: float = dataclasses.field(default_factory=lambda: time(), init=False) # noqa: PLW0108 |
There was a problem hiding this comment.
Could you add a justification comment explaining what the rule demands?
updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.14 → v0.15.4](astral-sh/ruff-pre-commit@v0.14.14...v0.15.4) - [github.com/tox-dev/pyproject-fmt: v2.12.1 → v2.16.2](tox-dev/pyproject-fmt@v2.12.1...v2.16.2)
c6e3a59 to
70abc5a
Compare
for more information, see https://pre-commit.ci
updates: