Skip to main content

patch the migration maker to use ruff if available

Project description

django-migrations-ruff-formatter

Patches the Django formatter to use ruff, so you don't have to ignore formatting for your migrations.

Installation

Add to your project one way or another

uv add --dev 'django-migrations-ruff-formatter>=0.1.0'

or if you're living under a rock...

pip install django-migrations-ruff-formatter

and in your settings, add this

INSTALLED_APPS = [
    # ...
    'django_migrations_ruff_formatter.apps.RuffFormatter',
]

The patcher just invokes ruff format *migrations and ruff check --fix *migrations. This means it picks up your ruff config from your project.

You can pass extra args to ruff by setting RUFF_EXTRA_FORMAT_ARGS or RUFF_EXTRA_LINT_ARGS in your django settings. For example:

RUFF_EXTRA_FORMAT_ARGS=["--force-exclude"]

Use

Just like before:

uv run ./manage.py makemigrations

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_migrations_ruff_formatter-0.1.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file django_migrations_ruff_formatter-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django_migrations_ruff_formatter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f5242b6d45b8c9e2242c342318cfcdf78eea5cef9c27f58ae8183ac097aca6e8
MD5 e7739acf0bf292bcceb35f32178c60e5
BLAKE2b-256 f27eeda3fec19e84d39cbfd7a7f549ed3cd8a0334ef9169d6c80bb6660a3bde9

See more details on using hashes here.

File details

Details for the file django_migrations_ruff_formatter-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_migrations_ruff_formatter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 451a8119231190181d33244ba06b3cd88a2566680ab38ad9f184f72af5486bba
MD5 337b5dd17470bdacff598105fa103415
BLAKE2b-256 6d03423b14f5a2a99146cb8495ef9bd0dccb31c37ec3950a2dae595db05849be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page