Saturday 13 July 2024

Fine-Tuning Python Code Formatting: Ignoring Django Migrations in pyproject.toml



When setting up code formatters like Black in a Django project, you might encounter an issue where the formatter attempts to reformat migration files. These files, being automatically generated, usually don’t require formatting and can cause unnecessary noise in commit diffs. Here, we explore various approaches to exclude Django migration files from Black’s formatting rules in the pyproject.toml configuration file.

Read more »

Labels: