General Coding Standards for Task Scripts

Overview

This page outlines our guidelines for task script coding standards which apply to all task scripts.

Guidelines

  • All function inputs and outputs should be typed, and pass pylance typechecking

  • Avoid deeply nested function calls, in favour of a flatter structure, which is easier to debug

  • Docstrings should be brief 1 sentence summaries, in favour of good argument names & types instead of explanations

    • Exception: If the function performs complex logic, a docstring can be used to explain it in more detail

  • Comments in the code should be brief, in favour of readable code with clear variable and function names

    • Exception: If the code performs complex logic, a comment can be used to explain the line of code in more detail for future developers