Skip to content
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

Workaround for clash between ruff in pre-commit hook and pytest-ruff #4705

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

abravalheri
Copy link
Contributor

@abravalheri abravalheri commented Oct 25, 2024

Summary of changes

See jaraco/skeleton#149.

  • Bump version of ruff hook in .pre-commit-hooks.yaml
  • Run ruff autoformat.

Hopefully this will not have merge conflicts when we merge skeleton next time 🤞 (jaraco/skeleton#150).

This PR is just to keep things working and prevent the CI from failing in unrelated PRs. We can change the approach in a follow up.

Pull Request Checklist

@abravalheri abravalheri merged commit 1ca55c9 into pypa:main Oct 25, 2024
25 checks passed
@abravalheri abravalheri deleted the workaround-ruff branch October 25, 2024 17:18
@Avasam
Copy link
Contributor

Avasam commented Oct 25, 2024

(technically updating pre-commit isn't even necessary: pip install -e .[check] -U & ruff format, but may as well keep it in sync for those who use it ^^)

@abravalheri
Copy link
Contributor Author

If I simply run ruff format it modifies the files, however, once you try to commit them, the pre-commit hook modifies them back... Which leads to a "unstable" state, where the 2 versions of ruff keep competing with each other to modify the files according to their liking.

I could simply use --no-verify for the commit, but at that stage it is better to simply remove the pre-commit hooks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants