From f588686c427d86863605157571175c77025b6393 Mon Sep 17 00:00:00 2001 From: DMRobertson Date: Thu, 14 Apr 2022 10:33:41 +0000 Subject: deploy: 535a689cfcec896dd4ce74ef567bd30c11ade9e3 --- develop/print.html | 47 ++++++++++++++--------------------------------- 1 file changed, 14 insertions(+), 33 deletions(-) (limited to 'develop/print.html') diff --git a/develop/print.html b/develop/print.html index a12513359e..ddcc4966e8 100644 --- a/develop/print.html +++ b/develop/print.html @@ -13490,49 +13490,30 @@ do!

The Synapse codebase uses a number of code formatting tools in order to quickly and automatically check for formatting (and sometimes logical) errors in code.

-

The necessary tools are detailed below.

-

First install them with:

-
pip install -e ".[lint,mypy]"
-
+

The necessary tools are:

+

Install them with:

+
pip install -e ".[lint,mypy]"
 
- -
  • -

    isort

    -

    isort ensures imports are nicely formatted, and can suggest and -auto-fix issues such as double-importing.

    -

    Auto-fix imports with:

    -
    isort .
    +

    The easiest way to run the lints is to invoke the linter script as follows.

    +
    scripts-dev/lint.sh
     
    -
  • -

    It's worth noting that modern IDEs and text editors can run these tools automatically on save. It may be worth looking into whether this functionality is supported in your editor for a more convenient -development workflow. It is not, however, recommended to run flake8 on -save as it takes a while and is very resource intensive.

    +development workflow. It is not, however, recommended to run flake8 or mypy +on save as they take a while and can be very resource intensive.

    General rules

    • Naming:
        -
      • Use camel case for class and type names
      • -
      • Use underscores for functions and variables.
      • +
      • Use CamelCase for class and type names
      • +
      • Use underscores for function_names and variable_names.
    • Docstrings: should follow the google code -- cgit 1.5.1