Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.18 KB

style_guide.md

File metadata and controls

49 lines (34 loc) · 1.18 KB

Style Guide for FCMpy Development

FCMpy package follows PEP-8 style guide.

Indentation

  • 4 spaces for indentation
  • Vertically align longer expression

Maximum Line Length

  • 79 characters in a line (whenever possible)
  • 72 characters in a line for comments (whenever possible)
  • Add a break before or after a binary operator

Blank Lines

  • Top-level function and classes are separated by two blank lines
  • Method definitions inide classes should be separated by one blank line

Whitespaces in Expressions and Statements

  • Refer to PEP-8 examples

Imports

  • State each import on a single line
  • Order of imports:
    • Standard library imports
    • Related third-party imports
    • Local application/library specific imports
  • Absolute imports

Comments

  • Block comments -> explain more complex code
  • LIne comments -> simple lines.
  • Use docstrings for public modules, files, classes and methods start with """"""

Naming Conventions

  • Module -> lowercase
  • Class -> CapWords
  • Functions -> lowercase
  • methods -> lowercase
  • Type variables -> CapWords
  • Constants -> UPPERCASE
  • Package -> lowercase
  • Do not use 'l', 'O', or 'I' as a single variable name