Skip to content

contribution guide

Levin Eric Zimmermann edited this page Apr 15, 2022 · 12 revisions

programming style guide

  1. use import module instead of from module import something, follow pep8-guidelines regarding imports (1. Standard library imports, 2. Related third party imports, 3. Local application/library specific imports.)
  2. consider writing a static method if a utility function is only used in one class
  3. always use typing and test via mypy
  4. use DOC-strings with sphinx docstring format
  5. use format style Black (max-line-length 88 characters)
  6. use relative imports within modules
  7. write one module (several classes or functions) per file and add all public functions and classes to a global __all__ variable at the beginning of the file

naming conventions

  1. use plural form for module names
  2. avoid plurals as variable names: better write VARIABLE_TYPE, for instance "pitch_list" or "pitch_tuple" instead of pitches
  3. use consistent and meaningful variable names in methods (e.g. the classname written in lowercase)
  4. avoid abbreviations (because abbreviations make it more difficult for anyone who is new to the library)
  5. converter names should have the form InputToOutput e.g. MilkToCheese or GrapeToWine
  6. mutwo modules should have the form EXTENSION_MODULE where EXTENSION is the name of the mutwo extension and MODULE is one of the standard mutwo module names (events or parameters or generators or utilities or converters or constants: see next section modules), e.g. karawaitan_parameters for extension mutwo.ext-karawitan

git guide

  1. commits should be atomic (types of changes should be grouped together)
  2. please try to follow this guide regarding commit messages
Clone this wiki locally