Update hooks in used
Install pre-commit via 'apt' or pip
Recommended way to install it outside of poetry virtualenv
Document how to 'run' tools installed into pre-commit virtualenv
We are using [`pre-commit`](https://pre-commit.com/) tool to perform checks on staged changes before committing. Such as black formatting.
We are using [`pre-commit`](https://pre-commit.com/) tool to perform checks on staged changes before committing.
Depending whether you prefer to work ouside or inside Poetry virtual environment, you should stick to one usage or use both to still have this usefull checks.
We are using it for `black` formatting, `isort` imports sorting, `pylint` code linting, `mypy` typing, and `gitlab-ci` linting.
`pre-commit` can be used from the installation on your system or from inside Poetry virtual environment where it is installed.
Install `pre-commit` from your distribution. In case it is an outdated version, install it from `pip`:
```bash
sudo apt install pre-commit
pip install--user pre-commit
```
To install the `git-hooks`, run:
To install the `git-hooks`, run:
```bash
```bash
pip3 install--user pre-commit
duniterpy> pre-commit install
duniterpy> pre-commit install
```
```
Then each time you commit changes, the hooks will perform checks.
To manually run one of the tool above, run (eg for `isort`):