Ignoring Django Migrations in pyproject.toml file for Black formatter
Add the migration exclusion to your .pre-commit-config.yaml
file
- id: black
exclude: ^.*\b(migrations)\b.*$
That's the solution to the problem: pyproject.toml
[tool.black]
exclude = '''
/(
| migrations
)/
'''
Try this (note last line):
[tool.black]
line-length = 79
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| migrations
)/
'''