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

Suggest changes #52

Closed
pbrisbin opened this issue Jul 3, 2019 · 2 comments
Closed

Suggest changes #52

pbrisbin opened this issue Jul 3, 2019 · 2 comments
Projects

Comments

@pbrisbin
Copy link
Member

pbrisbin commented Jul 3, 2019

We could use our restyled diff(s) to make comments via the GitHub API to "suggest changes" on the PR to fix style.

This sounds absolutely ideal:

  • You can see individual fixes
  • They can be batched and merged automatically as a group
  • No need for PRs or back-comments or any of that

However, there are limitations and downsides that stem from the fact that a suggested change is very oriented around suggesting a different line for one added line. The first step here is to get specific about those limitations and figure out how they may impact the 80% case of Restyle fixes.

@pbrisbin pbrisbin added this to Backlog in Restyled via automation Jul 3, 2019
@pbrisbin pbrisbin moved this from Backlog to Planned in Restyled Jul 3, 2019
@pbrisbin pbrisbin moved this from Planned to Backlog in Restyled Jul 9, 2019
@pbrisbin pbrisbin added the beefy label Sep 4, 2019
@iphydf
Copy link

iphydf commented May 4, 2020

I like this idea, here are some thoughts on heuristics:

  1. Use suggest changes only if
    1. less than a given percentage of modified lines are affected.
    2. less than a given number of adjacent lines are affected.
  2. Use a github comment with a patch if the diff total is less than some number of lines.
  3. Use a PR otherwise.

You could make those things configurable. Most of the time I find that it's 1-2 lines of diff from the restyler, and having a github comment or suggestion is less clutter than a whole PR. The PR gives you a nice workflow where you can just pull the changes from there from the command line, but it's quite a lot of email spam, because the restyled PR doesn't thread with the original.

@pbrisbin
Copy link
Member Author

pbrisbin commented May 4, 2020

but it's quite a lot of email spam, because the restyled PR doesn't thread with the original

Totally agree with this. I wish there were a good answer to solving that, generally.

@pbrisbin pbrisbin moved this from Backlog to Icebox in Restyled Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Restyled
Icebox
Development

No branches or pull requests

2 participants