Skip to content

Instantly share code, notes, and snippets.

@zulvkr
Forked from frafra/.pre-commit-config.yaml
Created October 15, 2022 10:08
Show Gist options
  • Save zulvkr/2f05053f3d86c11e610f6b1e04aa2e4c to your computer and use it in GitHub Desktop.
Save zulvkr/2f05053f3d86c11e610f6b1e04aa2e4c to your computer and use it in GitHub Desktop.
Good defaults for a Python project: Poetry + pre-commit + black + flakehell + isort
repos:
- repo: local
hooks:
- id: black
name: black
entry: black
language: system
types: [python]
- repo: local
hooks:
- id: flakehell
name: flakehell
entry: flake8helled
language: system
types: [python]
- repo: local
hooks:
- id: isort
name: isort
entry: isort
language: system
types: [python]
# [...]
[tool.poetry.dev-dependencies]
pre-commit = "^2.12.0"
pytest = "^6.2.3"
black = "^20.8b1"
flakehell = "^0.9.0"
isort = "^5.8.0"
[tool.flakehell]
# https://flakehell.readthedocs.io/
# https://black.readthedocs.io/en/stable/compatible_configs.html?highlight=flake8#flake8
max-line-length = 88
extend-ignore = "E203, W503"
# https://github.com/flakehell/flakehell/issues/10#issuecomment-822720074
extended_default_ignore = [] # add this
[tool.isort]
# https://pycqa.github.io/isort/docs/configuration/black_compatibility/
profile = "black"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment