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.3.tar.gz (2.7 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.3.tar.gz.

File metadata

File hashes

Hashes for django_migrations_ruff_formatter-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c53f9807b3d0386c92c3549057c859dd5eb21c9ac70861d92e37e108839f619c
MD5 f8b7da3e7784187990baa2dbd541eafe
BLAKE2b-256 58aaf592fe85d99b49d657e4544836ba60576477319682590d386bda5a2c55da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_migrations_ruff_formatter-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5b81152a51e5a50dd9149e4a6bd78793319442b69cb16a9b61b3fab264cf7684
MD5 e945b36789080bf38d54445b723fc416
BLAKE2b-256 8b33c25c687d1d7ee7001e4b53ffc927fd0ca6b8b21549b85e80e83578cfd7b4

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