Using GitHub Copilot for code reviews: from VS Code to github.com
40 segments
Here we have a project
open in Visual Studio Code.
Some changes have been made
and we're ready to create a commit.
But before we create it,
we're going to ask GitHub Copilot
to take a look at the code
for some initial feedback.
And we can see it has some suggestions on
how the code can be improved across multiple files.
Copilot code review catches issues like logic bugs,
unclear error messages, insecure coding patterns,
and even deviations from coding guidelines.
And we can apply changes directly without ever
leaving the context of our code editor.
Copilot code reviews are also
available on github.com.
Here is the same code we wrote in a newly-opened
pull request.
We can assign copilot
for an initial review
before asking a team member or maintainer
to spend their time on it.
You can also assign
Copilot automatically on some or all
new pull requests.
As a result of the review,
Copilot will add comments to our pull request.
As you can see here, there are comments around
writing more efficient code
and also around error handling.
Copilot will also come in with suggestions
that we can apply in one click
with the commit suggestion button.
Copilot can also use your repository’s
copilot-instructions file to shape
how it will review.
When we have responded to the feedback,
we can re request a review from Copilot
for the next round of suggestions.
Ask follow-up questions or revisit key timestamps.
This video demonstrates how GitHub Copilot can assist developers by performing automated code reviews both within Visual Studio Code and directly on GitHub pull requests. It highlights features such as identifying bugs and insecure patterns, automated feedback, and the ability to apply suggestions with a single click.
Videos recently processed by our community