In python project I have pre-commit-config.yaml with black and mypy checkers. The goal is to before checking for errors, first run black . and mypy ./ to fix possible errors and then run hooks.
- repo: local
hooks:
- id: code-formatter
exclude: .pre-commit-config.yaml
name: Format code
entry: black .
language: python
- id: mypy
exclude: .pre-commit-config.yaml
name: Check types
entry: mypy --scripts-are-modules ./
language: python