diff --git a/README.md b/README.md index 24b00ffd..0bff7bcd 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,13 @@ To get `freezing-web` to permanently use the `freezing-model` changes you will h ### Coding standards -The `freezing-web` code is intended to be [PEP-8](https://www.python.org/dev/peps/pep-0008/) compliant. Code formatting is done with [black](https://black.readthedocs.io/en/stable/) and can be linted with [flake8](http://flake8.pycqa.org/en/latest/). See the [.flake8](.flake8) file and install the test dependencies to get these tools (`pip install -r test-requirements.txt`). +The `freezing-web` code is intended to be [PEP-8](https://www.python.org/dev/peps/pep-0008/) compliant. Code formatting is done with [black](https://black.readthedocs.io/en/stable/), [isort](https://pycqa.github.io/isort/) and [djlint}(https://www.djlint.com/) and can be linted with [flake8](http://flake8.pycqa.org/en/latest/). See the [.flake8](.flake8) file and install the test dependencies to get these tools (`pip install -r test-requirements.txt`). + +To run _all_ the linters and formatters, use the following commands: +``` +bin/lint.sh +bin/fmt.sh +``` ## Docker Deployment diff --git a/bin/fmt.sh b/bin/fmt.sh new file mode 100755 index 00000000..ddf8b3f9 --- /dev/null +++ b/bin/fmt.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +echo "Running formatters" +echo "*** black ***" +black freezing +echo "*** isort ***" +isort freezing +echo "*** djlint ***" +djlint --reformat freezing/web/templates + diff --git a/bin/lint.sh b/bin/lint.sh new file mode 100755 index 00000000..0fa0fb7f --- /dev/null +++ b/bin/lint.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +echo "Running linting checks" +echo "*** black ***" +black --check freezing +echo "*** isort ***" +isort --check freezing +echo "*** flake8 ***" +flake8 freezing +echo "*** mypy ***" +echo "*** djlint ***" +djlint --check freezing/web/templates +