Skip to content

Instantly share code, notes, and snippets.

@frafra
Last active November 30, 2023 03:36
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save frafra/8a877bd627ad49283585afa9a88790e2 to your computer and use it in GitHub Desktop.
Save frafra/8a877bd627ad49283585afa9a88790e2 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