githubpull-requestgitlens

Is there a way to suggest edits to a PR?


Is there a commonly used way to add small edits as code suggestions that the author of a PR can either accept or decline? Something similar to the way a Google Doc allows you to "Suggest Edits"

I'd like to speed up code reviews, and I think this would be a great teaching tool.


Solution

  • The short answer - yes, there is.

    You can add a block inside a fence marked with "suggestion":

    ```suggestion
    throw new Exception("awesome!");
    ```
    

    This will create a suggestion with code that can be applied automatically: enter image description here

    For additional details, see GitHub's documentation about commenting on a pull request and incorporating feedback.