If you use Poetry, it's possible to configure all the above in the pyproject.toml file as a workaround.
For example, my project looks like this:
[tool.black]
line-length = 130
target-version = ['py310']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
)/
'''
[tool.flake8]
max-line-length = 130
extend-ignore = ["D203", "E203", "E251", "E266", "E302", "E305", "E401", "E402", "E501", "F401", "F403", "W503"]
exclude = [".git", "__pycache__", "dist"]
max-complexity = 10
[tool.isort]
atomic = true
profile = "black"
line_length = 130
skip_gitignore = true
This is combined with a .pre-commit-config.yaml file that kicks off each tool upon commits, respectively:
fail_fast: true
repos:
- repo: https://github.com/ambv/black
rev: 22.10.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
hooks:
- id: isort
Haven't used the individual linters much outside of pre-commit hooks, but would think they behave the same way when run via poetry shell
or poetry run black --check --diff file_name.py
for instance.