Skip to content

Instantly share code, notes, and snippets.

@kruttik-lab49
Last active September 29, 2020 16:17
Show Gist options
  • Select an option

  • Save kruttik-lab49/59a2a3bff9c9f269b2330f7fa8f3f40b to your computer and use it in GitHub Desktop.

Select an option

Save kruttik-lab49/59a2a3bff9c9f269b2330f7fa8f3f40b to your computer and use it in GitHub Desktop.
TWL-Lab49/code review comments vs suggestion

Suppose, you see a typo or logic error in a PR-

if(str == "somevalue"){
  // do something
}

Clearly, this is a forgivable (some might say unforgivable) developer oversight. Generaly, we add a comment to such PRs as follows-

Logic error. Change to str.equals()

But we can do better. How about suggesting a code change that can be incorpated directly from PR. To add a suggestion, do this instead-

```suggestion
if(str.equals("somevalue"){
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment