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

[Issue]: Fix stability of git pre-commit format checks. #1418

Closed
afourney opened this issue Jan 26, 2024 · 11 comments
Closed

[Issue]: Fix stability of git pre-commit format checks. #1418

afourney opened this issue Jan 26, 2024 · 11 comments
Assignees
Labels
dev development experience/productivity

Comments

@afourney
Copy link
Member

afourney commented Jan 26, 2024

Can we please do something to improve the stability of the pre-commit formatting checks?

I'll pull a fresh copy of the repo, edit one line in one file, and end up failing some pre-commit check in an unrelated part of the code. Sometimes there are even errors in files that I haven't edited, causing the commit to succeed, but the server-side check to fail. Easily half my commits are fixes to these kinds of formatting checks.

I have no idea what is causing the instability. But it is maddening.

Also, pro-tip:

pre-commit run --all-files

Steps to reproduce

No response

Screenshots and logs

No response

Additional Information

No response

@afourney afourney self-assigned this Jan 26, 2024
@gagb gagb added the dev development experience/productivity label Jan 26, 2024
@gagb
Copy link
Collaborator

gagb commented Jan 26, 2024

Are you having these issues in code spaces?

@afourney
Copy link
Member Author

No. My local Ubuntu LTS dev environment.

(Autogenbench I don't think runs in code spaces due to special docker requirement)

@jackgerrits
Copy link
Member

It's weird because the pre-commit black version is already pinned

rev: 23.3.0

@jackgerrits
Copy link
Member

This repros in a fresh codespace

@afourney
Copy link
Member Author

afourney commented Jan 26, 2024

These latest issues I think are related to the notebooks. Notebooks use a different strategy for running black.

@sonichi
Copy link
Contributor

sonichi commented Jan 27, 2024

@davorrunje or @bitnom do you have a clue?

@afourney
Copy link
Member Author

FWIF, I'm still experiencing this instability with some of my commits.

I've been working around it by running pre-commit on all files, then staging the changes, then uninstalling pre-commit before committing (other they just change back and forth in a loop)

@davorrunje
Copy link
Collaborator

Sorry for the late reply, I am just catching up with the backlog. I always use

pre-commit run --all-files

just to be on the safe side.

@sonichi With respect to notebooks, I added black to notebooks using nbqa and never had any issue with it before. Is this still happening?

@ekzhu
Copy link
Collaborator

ekzhu commented Feb 13, 2024

@afourney Is this already fixed?

@afourney
Copy link
Member Author

It has not happened to me in a while. Perhaps safe to close.

@ekzhu ekzhu closed this as completed Feb 13, 2024
@ekzhu
Copy link
Collaborator

ekzhu commented Feb 13, 2024

I love closing issues

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

No branches or pull requests

6 participants