Skip to content

[pre-commit.ci] pre-commit autoupdate#14175

Open
pre-commit-ci[bot] wants to merge 6 commits intomainfrom
pre-commit-ci-update-config
Open

[pre-commit.ci] pre-commit autoupdate#14175
pre-commit-ci[bot] wants to merge 6 commits intomainfrom
pre-commit-ci-update-config

Conversation

@pre-commit-ci
Copy link
Contributor

@pre-commit-ci pre-commit-ci bot commented Feb 9, 2026

updates:

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 6549b7e to e7092a9 Compare February 13, 2026 07:34
@Pierre-Sassoulas
Copy link
Member

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.

@Pierre-Sassoulas Pierre-Sassoulas added the skip news used on prs to opt out of the changelog requirement label Feb 14, 2026
pyproject.toml Outdated
directory = "misc"
name = "Miscellaneous internal changes"
showcontent = true
type = [
Copy link
Member

Choose a reason for hiding this comment

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

I'd rather move this to a towncrier.toml than have this weird formatting..

Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

Let's freeze it ? Might need to fork it so it's not upgraded automatically by pre-commit

Copy link
Member

Choose a reason for hiding this comment

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

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...

Copy link
Member

Choose a reason for hiding this comment

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

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.

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from e7092a9 to 30cae01 Compare February 16, 2026 20:52
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the pre-commit-ci-update-config branch from c5ae88f to 167ca3f Compare February 16, 2026 22:13
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 167ca3f to cc6dac9 Compare February 23, 2026 21:24
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the pre-commit-ci-update-config branch 3 times, most recently from 9fd6b83 to c6e3a59 Compare February 27, 2026 09:17
"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()`
Copy link
Member

Choose a reason for hiding this comment

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

Why ignore this globally? I'd only disable it inline in a few places where the other format is being tested.

Copy link
Member

Choose a reason for hiding this comment

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

This is a lot of work (60+ violations), more suited to another merge request.

lint.per-file-ignores."src/_pytest/_version.py" = [
"I001",
]
lint.per-file-ignores."testing/**/*.py" = [ "RUF060" ]
Copy link
Member

Choose a reason for hiding this comment

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

I suppose this also deserves a justification. Dunno what this rule number is...

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
lint.per-file-ignores."testing/**/*.py" = [ "RUF060" ]
# 'Unnecessary membership test on empty collection', always voluntary in tests
lint.per-file-ignores."testing/**/*.py" = [ "RUF060" ]


def get_file_part_from_node_id(x: str) -> str:
return x.split("::")[0]
return x.split("::", maxsplit=1)[0]
Copy link
Member

Choose a reason for hiding this comment

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

This isn't a formatting change — do we need a change note mentioning refactoring?

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas Mar 9, 2026

Choose a reason for hiding this comment

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

It's a small optimization, but we could add a changelog for this (and the other). Let me know what you think.

# 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
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a justification comment explaining what the rule demands?

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas Mar 9, 2026

Choose a reason for hiding this comment

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

Suggested change
time: float = dataclasses.field(default_factory=lambda: time(), init=False) # noqa: PLW0108
# So disabling pylint's 'unnecessary-lambda' / 'PLW0108' in ruff
time: float = dataclasses.field(default_factory=lambda: time(), init=False) # noqa: PLW0108

Copy link
Member

Choose a reason for hiding this comment

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

It's already justified by the comment, sadly ruff do not have the pylint naming scheme that make it self evident what's being noqaed

Copy link
Member

Choose a reason for hiding this comment

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

We could also disable for pylint and remove the project disable, the pylint disable-next replace the comment and serves a purpose

Suggested change
time: float = dataclasses.field(default_factory=lambda: time(), init=False) # noqa: PLW0108
# pylint: disable-next=lambda-assignment
time: float = dataclasses.field(default_factory=lambda: time(), init=False) # noqa: PLW0108

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from c9e7b99 to 2c4200d Compare March 9, 2026 21:38
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the pre-commit-ci-update-config branch from 29d8742 to e5ab9be Compare March 9, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants