Replaced flake8/isort with ruff configuration#2499
Replaced flake8/isort with ruff configuration#2499vidhiii1711 wants to merge 3 commits intodjango:mainfrom
Conversation
Co-authored-by: Mark Walker <theshow@gmail.com>
|
@marksweb |
| hooks: | ||
| - id: flake8 | ||
| - id: ruff | ||
| args: ["--fix"] |
There was a problem hiding this comment.
If you are dropping flake8, you might want to add ruff-check too.
There was a problem hiding this comment.
I'd prefer this to be in a pyproject.toml file. As a first step towards consolidating all project configuration there.
| ] | ||
|
|
||
| ignore = [ | ||
| "E501", |
There was a problem hiding this comment.
A comment on both the select and ignore what those letters and codes mean goes a long way.
| [lint.per-file-ignores] | ||
| "djangoproject/settings/*.py" = ["F405"] | ||
| "docs/tests.py" = ["E501"] | ||
| "**/migrations/*" = ["RUF012"] |
There was a problem hiding this comment.
This has been added to the exclude list.
| "djangodocs", | ||
| ".direnv", | ||
| ".venv", | ||
| "**/migrations/*", |
There was a problem hiding this comment.
It's excluded here, but your patch includes countless migration files.
|
After a lot of initial hesitation, I am a big fan of ruff now. However, did you consult the website working group about this? |
|
@codingjoe All the points are well noted:
Regarding the website working group consultation — I should have done that before opening this PR. I'll reach out to them first and will update the PR once confirmation comes through. Thanks again for your patience and guidance! |
|
unsubscribe pls
…On Thu, Mar 12, 2026 at 8:15 PM Vidhi Singh ***@***.***> wrote:
*vidhiii1711* left a comment (django/djangoproject.com#2499)
<#2499 (comment)>
@codingjoe <https://github.com/codingjoe> I hadn't consulted the website
working group before opening this PR — I should have done that first. I'll
post about this on the Django Forum and will wait for their confirmation
before proceeding further.
—
Reply to this email directly, view it on GitHub
<#2499 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJGAATV76RJUUJ2XZ26JRXT4QLESNAVCNFSM6AAAAACUD7RL4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DANBXGMZTCMBYGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
@vidhiii1711 can you rebase this branch and solve the conflicts? |
Description:
This PR introduces a ruff.toml configuration to replace the existing flake8 and isort setup.
The configuration aims to be a 1-to-1 match with the current linting behavior:
-> Preserves existing ignores and file-specific exceptions (e.g. Django settings star imports).
-> Keeps line length and import ordering consistent with the current setup.
-> Avoids functional or formatting changes beyond what the existing tools already enforce.
This keeps linting behavior stable while consolidating configuration under Ruff, as discussed in #2446.