-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
CLN: Fix code formatting to address pre-commit and build failures #61609
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
Conversation
I think as per the documentation I should rename my commit to CLN: Code cleanup. |
Not sure where you saw pre-commit flagging issues, but the CI is green for main, I think all is good (based on our validations). Maybe you run things locally with different versions of the validation tools? |
Yeah makes sense — but even on a clean main, pre-commit fails for me unless I run Ruff. Even adding just a comment triggers it, so I don’t think it’s a version mismatch. Might be that pre-commit is catching things CI isn’t? Also seeing the docstring validation failing — happy to fix it if needed, or we can just drop the PR if it’s not worth changing right now. Let me know what you prefer! |
We do check pre-commit in the CI, with main and a clean install of the pre-commit tools if I'm not wrong. And it's green for main, so it seems like you've got something different than our CI locally. I'll run pre-commit to this PR to see how it looks like. |
pre-commit.ci autofix |
""" | ||
|
||
def missing_whitespace_around_arithmetic_operator(self) -> None: | ||
""" | ||
Examples | ||
-------- | ||
>>> 2+5 | ||
>>> 2 + 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are fixing those, which are incorrect docstrings used to test incorrect docstrings. All these changes need to be reverted. This is why the CI is red for your PR.
Ahh got it — makes sense now. I’ll revert those changes to the test docstrings. Thanks for pointing that out! |
The problem was that after making the code change, I was manually running ruff format and ruff check --fix, which applied to the entire directory. After running pre-commit, I realized that everything outside the pandas/ directory is skipped, along with pandas/tests/, when using pre-commit run --all-files. |
Run ruff --fix and ruff format to fix style issues flagged by pre-commit.
This resolves common RUF003 errors (e.g., ambiguous hyphens) seen across multiple PRs.