[Django] #35832: use ruff for linting/formatting/sorting instead of black/flake8/isort

13 views
Skip to first unread message

Django

unread,
Oct 12, 2024, 2:27:28 AM10/12/24
to django-...@googlegroups.com
#35832: use ruff for linting/formatting/sorting instead of black/flake8/isort
-------------------------------------+-------------------------------------
Reporter: Ahmed Ibrahim | Type:
| Cleanup/optimization
Status: new | Component:
| Uncategorized
Version: | Severity: Normal
Keywords: linting, | Triage Stage:
formatting, styling | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
This will provide a performance boost, and it has most if not all the
rules needed
Ruff URL: https://github.com/astral-sh/ruff

Comparison provided by ruff team

[[Image(https://user-images.githubusercontent.com/1309177/232603514
-c95e9b0f-6b31-43de-9a80-9e844173fd6a.svg)]]

Ruff is faster than the 3 replacements **combined**
--
Ticket URL: <https://code.djangoproject.com/ticket/35832>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 12, 2024, 2:31:39 AM10/12/24
to django-...@googlegroups.com
#35832: use ruff for linting/formatting/sorting instead of black/flake8/isort
-------------------------------------+-------------------------------------
Reporter: Ahmed Ibrahim | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Uncategorized | Version:
Severity: Normal | Resolution:
Keywords: linting, | Triage Stage:
formatting, styling | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Ahmed Ibrahim:

Old description:

> This will provide a performance boost, and it has most if not all the
> rules needed
> Ruff URL: https://github.com/astral-sh/ruff
>
> Comparison provided by ruff team
>
> [[Image(https://user-images.githubusercontent.com/1309177/232603514
> -c95e9b0f-6b31-43de-9a80-9e844173fd6a.svg)]]
>
> Ruff is faster than the 3 replacements **combined**

New description:

This will provide a performance boost, and it has most if not all the
rules needed
Ruff URL: https://github.com/astral-sh/ruff

Comparison provided by ruff team

[[Image(https://i.imgur.com/MbRTKYL.png)]]

Ruff is faster than the 3 replacements **combined**

--
--
Ticket URL: <https://code.djangoproject.com/ticket/35832#comment:1>

Django

unread,
Oct 12, 2024, 3:05:08 AM10/12/24
to django-...@googlegroups.com
#35832: use ruff for linting/formatting/sorting instead of black/flake8/isort
-------------------------------------+-------------------------------------
Reporter: Ahmed Ibrahim | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Uncategorized | Version:
Severity: Normal | Resolution:
Keywords: linting, | Triage Stage:
formatting, styling | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* cc: Adam Johnson (added)

Comment:

I’m inclined to say this would need a community discussion on the Forum.

For what it’s worth, I would much prefer that we stick with community
tools, rather than VC controlled alternatives.
Perhaps I’m alone in that concern. (I’d ask Adam’s take personally, and
probably defer to that.)
--
Ticket URL: <https://code.djangoproject.com/ticket/35832#comment:2>

Django

unread,
Oct 12, 2024, 3:49:56 AM10/12/24
to django-...@googlegroups.com
#35832: use ruff for linting/formatting/sorting instead of black/flake8/isort
-------------------------------------+-------------------------------------
Reporter: Ahmed Ibrahim | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Uncategorized | Version:
Severity: Normal | Resolution:
Keywords: linting, | Triage Stage:
formatting, styling | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ahmed Ibrahim):

Replying to [comment:2 Carlton Gibson]:
> I’m inclined to say this would need a community discussion on the Forum.
>
> For what it’s worth, I would much prefer that we stick with community
tools, rather than VC controlled alternatives.
> Perhaps I’m alone in that concern. (I’d ask Adam’s take personally, and
probably defer to that.)

Your opinion is always appreciated, this is just a suggestion, a
recommendation, the first advantage we got is that if someone wants to
ruff at some point, he will be able to see this ticket and get an answer
--
Ticket URL: <https://code.djangoproject.com/ticket/35832#comment:3>

Django

unread,
Oct 12, 2024, 10:52:51 AM10/12/24
to django-...@googlegroups.com
#35832: use ruff for linting/formatting/sorting instead of black/flake8/isort
-------------------------------------+-------------------------------------
Reporter: Ahmed Ibrahim | Owner: (none)
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version:
Severity: Normal | Resolution: duplicate
Keywords: linting, | Triage Stage:
formatting, styling | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* component: Uncategorized => Core (Other)
* resolution: => duplicate
* status: new => closed

Comment:

Duplicate of #34460.
--
Ticket URL: <https://code.djangoproject.com/ticket/35832#comment:4>

Django

unread,
Oct 12, 2024, 6:56:41 PM10/12/24
to django-...@googlegroups.com
#35832: use ruff for linting/formatting/sorting instead of black/flake8/isort
-------------------------------------+-------------------------------------
Reporter: Ahmed Ibrahim | Owner: (none)
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version:
Severity: Normal | Resolution: duplicate
Keywords: linting, | Triage Stage:
formatting, styling | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Adam Johnson):

Happy to discuss on forum.

(I don't think the VC control is a concern: compare with how Flake8 is now
basically one person. I am concerned that Ruff is still technically beta
and its docs mostly defer to other project docs, making it a bit hard to
understand if you don't know or follow the history.)
--
Ticket URL: <https://code.djangoproject.com/ticket/35832#comment:5>
Reply all
Reply to author
Forward
0 new messages