Skip to content

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

Merged
Pierre-Sassoulas merged 6 commits intomainfrom
pre-commit-ci-update-config
Mar 22, 2026
Merged

[pre-commit.ci] pre-commit autoupdate#14175
Pierre-Sassoulas merged 6 commits intomainfrom
pre-commit-ci-update-config

Conversation

@pre-commit-ci
Copy link
Copy Markdown
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
Copy Markdown
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
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
directory = "misc"
name = "Miscellaneous internal changes"
showcontent = true
type = [
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread pyproject.toml Outdated
@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
Comment thread pyproject.toml
"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
Copy Markdown
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
Copy Markdown
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we need to do this TBH, I doubt new code added to pytest will use the legacy form.

Comment thread pyproject.toml

def get_file_part_from_node_id(x: str) -> str:
return x.split("::")[0]
return x.split("::", maxsplit=1)[0]
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/_pytest/timing.py
@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
@pre-commit-ci pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from e5ab9be to f9dc9c7 Compare March 16, 2026 21:34
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the pre-commit-ci-update-config branch from a5de04a to 2d2d1cf Compare March 17, 2026 06:41
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the pre-commit-ci-update-config branch from 2d2d1cf to 95e0ea2 Compare March 17, 2026 18:17
Copy link
Copy Markdown
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks @Pierre-Sassoulas for all the work on this!

Comment thread src/_pytest/timing.py
Comment thread pyproject.toml
"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
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we need to do this TBH, I doubt new code added to pytest will use the legacy form.

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the pre-commit-ci-update-config branch from 17b42a2 to 20ee4e9 Compare March 22, 2026 14:21
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the pre-commit-ci-update-config branch from 20ee4e9 to 51eb7a4 Compare March 22, 2026 14:26
@Pierre-Sassoulas
Copy link
Copy Markdown
Member

Thanks for the review @nicoddemus. I'm going to merge because on monday the pre-commit bot would force push its version for the fifth time if I don't 😄 I'll add the changelog and fix RUF061 in another MR if you feel it's required @webknjaz .

@Pierre-Sassoulas Pierre-Sassoulas merged commit 2ca0f8a into main Mar 22, 2026
33 checks passed
@Pierre-Sassoulas Pierre-Sassoulas deleted the pre-commit-ci-update-config branch March 22, 2026 14:51
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.

4 participants