Newer
Older
1. (optional, recommended) create and activate Python virtual environment
```bash
python -m venv <virtual env. path>
. <virtual env. path>/bin/activate
```
2. install Python requirements
```bash
pip install -r requirements.txt
```
3. follow steps from [pre-commit Quick start guide](https://pre-commit.com/#quick-start) to set it up and run it
1. [add/edit pre-commit configuration](https://pre-commit.com/#2-add-a-pre-commit-configuration), for example Python code formatter [Black](https://github.com/psf/black) (notice the authors advise to use the mirror repo [black-pre-commit-mirror](https://github.com/psf/black-pre-commit-mirror))
2. install Git hook scripts
```bash
pre-commit install
```
This creates a Git pre-commit hook that installs and runs pre-commit for other users of this repository as well.
3. run against files
```bash
pre-commit run --all-files
```