Skip to content

Instantly share code, notes, and snippets.

@tmabraham
Last active February 25, 2022 01:52
Show Gist options
  • Save tmabraham/31bd067e9c5c02384c743d428a7db3fa to your computer and use it in GitHub Desktop.
Save tmabraham/31bd067e9c5c02384c743d428a7db3fa to your computer and use it in GitHub Desktop.

For each function/class please check the following:

  • Is every argument on a new line, unless it's a self or cls keyword?
  • Is it formatted like this? (Pay attention to the location of the arguments on the newline and the closing parentheses):
def __init__(self, 
    a, 
    b, 
    c
)
  • Does every argument have a docstring?
  • Does every non-obvious argument have a docment comment? (Unless there is a good reason not to)
  • Are all the docment comments capitalized?
  • Does every non-obvious argument have a type annotation? (Unless there is a good reason not to)

Do this for every function/class. If you are skipping a function or class, there must be a very good reason not to docment (for example it is a very simple/self-explanatory function). Similarly, if you are skipping an argument, there must be a very good reason not to docment, like it is very obvious what it is and what its type is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment