Skip to main content

Best Practices for Submitting a Pull Request

Generally, a best practice to engage in before submitting your own pull request is to do a code review on your work.

Prior to submitting a PR, review your code for the following characteristics:

  1. Is the code READABLE?

    • Is it well-organized?
    • Are the class, variable, and method names clear and descriptive?
    • Are the formatting, spacing, comments, and indentations consistent?
    • Have you refactored the code to reduce repetition and nested code?
    • Have you included the appropriate comments to make your code readable to others?
  2. Have you followed the languageā€™s STYLE CONVENTIONS?

    • Are class, variable, and method names cased and capitalized according to the style conventions of the language (e.g. camelCase vs. snake_case)
  3. Is the code CORRECT?

    • Does the code work as intended?
    • Does the logic make sense and solve the intended problem?
    • Have you provided instructions for reviewers to setup and verify the solution works?
  4. Have you identified and accounted for BUGS and EDGE CASES?

  5. Have you anticipated all the issues that could arise in your code that the person doing your code review will raise?

  6. Do you understand every line of code you are submitting? If not, go through each line and write down questions to clarify everything you do not understand, then ask!