Skip to content

Apply lint to contributor PR on demand #1280

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

Merged
merged 4 commits into from
Nov 13, 2024
Merged

Apply lint to contributor PR on demand #1280

merged 4 commits into from
Nov 13, 2024

Conversation

msaroufim
Copy link
Member

@msaroufim msaroufim commented Nov 13, 2024

Some of my least favorite interactions with OSS users is asking them to lint their code, it causes huge delays in merging code for something that feels quite silly. See this PR as an example #1113

So instead when we feel like a contributor PR is close to getting merged, we can trigger a github action to push lint fixes to their branch directly

Main issue is this probably won't work for forks

And I got this working on my fork of ao https://github.com/msaroufim/ao

To test this I made a PR that ruins the lint on a specific file
Screenshot 2024-11-13 at 1 22 39 PM

You can see how the bot added changes to my PR

Screenshot 2024-11-13 at 1 19 22 PM

And this is how I trigger a lint job by passing in a link to the PR https://github.com/pytorch/ao/actions/workflows/ruff_linter.yml

Screenshot 2024-11-13 at 1 19 43 PM

Copy link

pytorch-bot bot commented Nov 13, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1280

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit fa0555a with merge base c546c5c (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 13, 2024
@msaroufim msaroufim added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label Nov 13, 2024
git config --global user.email 'github-actions[bot]@users.noreply.github.com'

# Apply fixes
ruff check --fix .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ruff check --select F,I --fix

I think we need this to match ci

@msaroufim msaroufim merged commit 333bde6 into main Nov 13, 2024
18 checks passed
@msaroufim msaroufim deleted the msaroufim-patch-29 branch November 13, 2024 23:20
sunjiweiswift pushed a commit to sunjiweiswift/ao that referenced this pull request Nov 25, 2024
* Apply lint to contributor PR on demand

* Update ruff_linter.yml

* Update ruff_linter.yml

* Update ruff_linter.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants