Upgrade Your Pull Requests With ChatGPT

I love reviewing pull requests and always make sure I spend enough time to give a thorough review.

And for me, a good description and explanation of the content of the code goes a long way.

We strive to write code that humans can read and understand easily.

That's why I want to share a tip that I use that will make your PRs shine.

How To Create Diagrams

Good diagrams help tremendously, either for debugging or for others to understand your ideas.

It conveys the intention of your code without showing the code itself.

If you can abstract your ideas into diagrams, you will find it easier to explain your problems to others.

That's why I suggest you learn UML notation.

UML [1] stands for unified modeling language. The main goal was to standardize the disparate notational systems and approaches to software design [2].

Now, we can move forward to how you can use UML with ChatGPT.

ChatGPT

I use the prompt to generate UML diagrams to avoid wasting time creating many diagrams to show on your pull request.

Use this code: [paste your code here]
Generate a class diagram/ sequence diagram/ etc using PlantUML notation.

Paste the result onto a plant UML editor (I use PlantText), and an image will be generated.

Here's the result that I got with this prompt for the file that I have on GitHub:

You can adapt the generated code based on your needs.

What matters is that you were able to save time with AI and improve the quality of your PRs.

Conclusion

AI is very helpful when performing repetitive tasks. You should use it to your advantage, but always review the output before sending it. πŸ˜›

What do you do to improve the readability of your pull requests?

Thank you for reading.

πŸ’‘
I love sharing free content to help fellow developers. Your support means a lot! Please follow me on LinkedInGitHub, and Twitter.
Let's connect and grow together! πŸš€

References

[1]: https://www.uml.org

[2]: https://en.wikipedia.org/wiki/Unified_Modeling_Language

[3]: https://github.com/Sailor-Saturn/Essential-Developer-Case-Study/blob/main/EssentialApp/EssentialApp/FeedUIComposer.swift

Subscribe to Coding With Vera

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe