From f588686c427d86863605157571175c77025b6393 Mon Sep 17 00:00:00 2001
From: DMRobertson 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: The necessary tools are: Install them with: black The Synapse codebase uses black
-as an opinionated code formatter, ensuring all comitted code is
-properly formatted. Have The easiest way to run the lints is to invoke the linter script as follows. flake8 Check all application and test code with: isort Auto-fix imports with: 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
+
+
-pip install -e ".[lint,mypy]"
-
black auto-format your code (it shouldn't change any
-functionality) with:black .
+
-scripts-dev/lint.sh
flake8 is a code checking tool. We require code to pass flake8
-before being merged into the codebase.
-flake8 .
-isort ensures imports are nicely formatted, and can suggest and
-auto-fix issues such as double-importing.
-isort .
-flake8 on
-save as it takes a while and is very resource intensive.flake8 or mypy
+on save as they take a while and can be very resource intensive.
CamelCase for class and type namesfunction_names and variable_names.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:
+The necessary tools are:
+Install them with:
pip install -e ".[lint,mypy]"
-black
-The Synapse codebase uses black -as an opinionated code formatter, ensuring all comitted code is -properly formatted.
-Have black auto-format your code (it shouldn't change any
-functionality) with:
black .
+The easiest way to run the lints is to invoke the linter script as follows.
+scripts-dev/lint.sh
-flake8
-flake8 is a code checking tool. We require code to pass flake8
-before being merged into the codebase.
Check all application and test code with:
-flake8 .
-
-isort
-isort ensures imports are nicely formatted, and can suggest and
-auto-fix issues such as double-importing.
Auto-fix imports with:
-isort .
-
-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.
flake8 or mypy
+on save as they take a while and can be very resource intensive.
CamelCase for class and type namesfunction_names and variable_names.