You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add cargo fmt --all and commit to github action #6204
@YashSuthar983 Make a commit from CI. We already have cargo fmt --check, and the solution is usually running cargo fmt --all and commit the changes. It can be trivially autumated.
So what i am thinking is that whenever user open a PR from fork , our CI run cargo fmt --all then if any changes this wil commit to pr of user right?
I don't think it is allowed by github or we need somthing like bot that use PAT of user for this.
@youknowone We can do one thing, whenever a user pushes to their fork, the CI pipeline run cargo fmt --all and if any formatting changes are needed, it should commit in their fork itself.
i tested this in repo. see pull request
if this satisfy need let me know ?
I tried another way on #6295 . Tested on #6296 and RustPython-test#1
As you shared, permission mattered. I'd better to try PAT earlier.
Let's see if it works.
Activity
YashSuthar983 commentedon Oct 24, 2025
@youknowone i have doubt , as cargo fmt --all formats the code then are we going to make an commit from CI ?
or we can use cargo fmt --all --check ?
ci: add auto-format job to run cargo fmt --all and auto-commit on PR …
youknowone commentedon Oct 26, 2025
@YashSuthar983 Make a commit from CI. We already have
cargo fmt --check, and the solution is usually runningcargo fmt --alland commit the changes. It can be trivially autumated.YashSuthar983 commentedon Oct 26, 2025
So what i am thinking is that whenever user open a PR from fork , our CI run cargo fmt --all then if any changes this wil commit to pr of user right?
I don't think it is allowed by github or we need somthing like bot that use PAT of user for this.
youknowone commentedon Oct 26, 2025
I didn't try that yet, but some github actions look like supporting it.
Not sure which one is best fit for this purpose though.
I can configure some variables on actions if it is required.
YashSuthar983 commentedon Oct 26, 2025
@youknowone We can do one thing, whenever a user pushes to their fork, the CI pipeline run cargo fmt --all and if any formatting changes are needed, it should commit in their fork itself.
i tested this in repo. see pull request
if this satisfy need let me know ?
YashSuthar983 commentedon Oct 28, 2025
@youknowone I’d like to know your thoughts on the solution, as it’s a hassle to remind everyone to run cargo fmt --all each time.
youknowone commentedon Oct 29, 2025
@YashSuthar983 I checked the repository and it is looking great! Could you apply the same workflow to RustPython too?
YashSuthar983 commentedon Oct 30, 2025
@youknowone i got confused as we can do two thing to be efficient and avoid conflicts .
youknowone commentedon Oct 30, 2025
I expected auto-format before all other workflow, but auto-format at end of workflow also sounds reasonable.
manual triggering is not a desired one. (better than no auto-format though)
youknowone commentedon Nov 14, 2025
@YashSuthar983 Thank you so much! it looks working great now
youknowone commentedon Nov 14, 2025
#6259 (comment)
youknowone commentedon Nov 25, 2025
I tried another way on #6295 . Tested on #6296 and RustPython-test#1
As you shared, permission mattered. I'd better to try PAT earlier.
Let's see if it works.
Thanks @YashSuthar983 and @ShaharNaveh
ShaharNaveh commentedon Dec 16, 2025
Closed by #6295