Suggestions 🎉#39
Conversation
|
@sunny looks good. Could you rebase this PR on top of current master? |
|
Hey @mmozuras, thanks for looking into this! I rebased against master. I am using the However for the long term, I am not convinced that using an environment variable is the best way to store this configuration. Would you have any better suggestions as to where to hold this list of suggestable cops? I am considering:
|
|
@sunny I like the idea of putting it somewhere/somehow in @doomspork what do you think? |
|
I believe GitHub suggestions only work with single-line diffs. What would happen if the RuboCop suggestion is longer than 1 line? Maybe there should be a check to make sure that only 1-line corrections get turned into suggestions, and other corrections just get included as code blocks? |
That would be awesome, we wouldn't need to keep a list of "safe cops" at all that way. However, I didn't manage to get it working that way since calling all cops with autocorrect can change the lines of the next suggestions. Maybe I need to continue digging to find a good solution. (Or if anybody has an idea on how to tackle this, would love some help.) |
|
@aergonaut @doomspork @mmozuras I figured out how to only show suggestions of cops that moved only one line. This means we don't need an environment variable that lists all cops, but just a configuration setting to enable/disable suggestions. \o/ What do you think? |
5482f66 to
1142472
Compare
|
@sunny sorry for the delay, that single option sounds ideal 👍 I'll review your PR and add the @prontolabs/core team as well for a final review. |
|
Any chance for a final review here? 🙏 |
|
@sunny sorry for the delays, could you rebase so I can merge? |
|
@doomspork Rebased! I fixed a few conflicts over the new configuration for severity. |
|
Woohoo! \o/ Thanks for the review and the merge. 🎉 |
When enabling
suggestions: truein the Pronto YML configuration underrubocop:, messages will include a line suggesting what to change, using GitHub's new syntax on Pull Request reviews.For example, for this change:
The message will have a suggestion in this format:
Which appears as GitHub comments like this:
That can be applied in one click right from the Pull Request.