Skip to content

Commit

Permalink
Add scripts to run lint and fmt and docs on them
Browse files Browse the repository at this point in the history
  • Loading branch information
obscurerichard committed Dec 19, 2024
1 parent 67aa76a commit a94074d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions bin/fmt.sh
Original file line number Diff line number Diff line change
@@ -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

12 changes: 12 additions & 0 deletions bin/lint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a94074d

Please sign in to comment.