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
ci/lint: fix calling Ruff's format #1457
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
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.
LGTM, but it's gonna be a huge pain for people to handle merge conflicts :(
Yeah, only other way is drop false hook with "formatting" |
@Borda I'm generally a fan of enforcing new style changes one by one as they change--is that possible here? |
@rbren Not sure what you mean, this is Black. |
It should be possible. We just need to run pre-commit only on changed files (i.e. on diff), not all files. @Borda the ask is, can we avoid linting all files in this PR? This is a huge PR that will cause a lot of open PRs to have merge conflicts. |
Yes, we can, just to be aware that many PRs will include unrelated changes to the PR's topic... |
I think that's fine. It definitely reduces the burden for developers. People hate merge conflicts and if they hate it too much, they will start to hate all linting efforts. |
@li-boxuan @rbren dropped applied pre-commit but noted that the lining job will fail... |
pre-commit run this method can ensure only checking the modified files. but it is a bit troublesome to apply to workflow. it needs to fetch the main and current branch and unshallow clone~ |
@rbren @li-boxuan what do you think of this method to transition? |
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.
LGTM!
it causes the lint workflow to fail right now 🤔 |
Love this approach
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Leo ***@***.***>
Sent: Wednesday, May 1, 2024 4:53 AM
To: OpenDevin/OpenDevin ***@***.***>
Cc: ***@***.*** ***@***.***>; Mention ***@***.***>
Subject: Re: [OpenDevin/OpenDevin] ci/lint: fix calling Ruff's format (PR #1457)
pre-commit run --files $(git diff --name-only $(git merge-base main $(git branch --show-current)) $(git branch --show-current) | tr '\n' ' ') ...
this method can ensure only checking the modified files. but it is a bit troublesome to apply to workflow. it needs to fetch the main and current branch and unshallow clone~
—
Reply to this email directly, view it on GitHub<#1457 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGENUWUVD5ON4IGEPRIWDF3ZADJS5AVCNFSM6AAAAABG7GJ5MOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYGM2DQMBSGI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Ugh you're right. Not sure how we did this in the past. Maybe we do just need to delint everything in this PR and deal with the merge headaches |
In the past we don’t have (enough) linting checks in CI.
How about dropping the CI enforcement for a while?
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Robert Brennan ***@***.***>
Sent: Wednesday, May 1, 2024 8:44:02 AM
To: OpenDevin/OpenDevin ***@***.***>
Cc: ***@***.*** ***@***.***>; Mention ***@***.***>
Subject: Re: [OpenDevin/OpenDevin] ci/lint: fix calling Ruff's format (PR #1457)
Ugh you're right. Not sure how we did this in the past. Maybe we do just need to delint everything in this PR and deal with the merge headaches
—
Reply to this email directly, view it on GitHub<#1457 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGENUWVJ47SNEIAN54APTGTZAEEUFAVCNFSM6AAAAABG7GJ5MOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYGY2TMMJUGE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I've pushed a patch for transition. It only checks the modified files from the commits. |
It seems that Ruff'f format was not called correctly; in fact, as both Ruff's IDs had overwritten
entry
, it was still calling check with a confusion ofid: ruff-format
Found based on #1425 (comment)
See the original entry call:
https://github.com/astral-sh/ruff-pre-commit/blob/596470fba20d04adc68ec7903ff69a12e5e1a8d3/.pre-commit-hooks.yaml#L15
cc: @rbren @li-boxuan