[Django] #32165: Add pre-commit Hooks

5 views
Skip to first unread message

Django

unread,
Nov 2, 2020, 2:32:20 PM11/2/20
to django-...@googlegroups.com
#32165: Add pre-commit Hooks
-----------------------------------------+------------------------
Reporter: David Smith | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
To add support for pre-commit hooks via [https://pre-commit.com/ pre-
commit]. Specifically, I propose to add the flake8 and isort hooks, with
appropriate guidance added to the contributing docs.

The aim is to reduce the number of PRs opened where a 'simple' lint error
needs to be fixed, and in doing so we end up running the whole test suite
at Jenkins twice. I appreciate this won't stop all instances as folk will
have an extra step to install them; however, I think even if it stops the
occasional occurrence the addition will be worthwhile.

--
Ticket URL: <https://code.djangoproject.com/ticket/32165>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 3, 2020, 2:56:48 AM11/3/20
to django-...@googlegroups.com
#32165: Add pre-commit Hooks
-------------------------------+--------------------------------------

Reporter: David Smith | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => needsinfo


Comment:

Hi David. I'd be inclined to accept this — I think pre-commit is great —
but I think we need to go via the DevelopersMailingList first to gather
consensus.

Ref [https://github.com/django/deps/blob/master/accepted/0008-black.rst
DEP 8] this would be handy to have in place.

Can I get you to post to the list? Some thoughts...

* Things we could set up now: the whitespace rule, flake8, isort.
* Add black when DEP 8 is implemented.
* What's the setup? Add to docs where?
* ...

Thanks

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

Django

unread,
Nov 6, 2020, 6:26:37 AM11/6/20
to django-...@googlegroups.com
#32165: Add pre-commit Hooks
-------------------------------+--------------------------------------
Reporter: David Smith | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Adam (Chainz) Johnson):

* cc: Adam (Chainz) Johnson (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/32165#comment:2>

Django

unread,
Dec 8, 2020, 5:23:49 AM12/8/20
to django-...@googlegroups.com
#32165: Add pre-commit Hooks
-----------------------------+---------------------------------------------

Reporter: David Smith | Owner: nobody
Type: New feature | Status: new
Component: Packaging | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by Carlton Gibson):

* status: closed => new
* type: Uncategorized => New feature
* component: Uncategorized => Packaging
* has_patch: 0 => 1
* resolution: needsinfo =>
* stage: Unreviewed => Ready for checkin


Comment:

[https://github.com/django/django/pull/13696#pullrequestreview-547008796
PR]

(This is about GitHub process. I have no idea what component to assign it
to really.)

--
Ticket URL: <https://code.djangoproject.com/ticket/32165#comment:3>

Django

unread,
Dec 8, 2020, 5:24:05 AM12/8/20
to django-...@googlegroups.com
#32165: Add pre-commit Hooks
-----------------------------+---------------------------------------------
Reporter: David Smith | Owner: David Smith
Type: New feature | Status: assigned

Component: Packaging | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by Carlton Gibson):

* owner: nobody => David Smith
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/32165#comment:4>

Django

unread,
Dec 23, 2020, 5:15:02 AM12/23/20
to django-...@googlegroups.com
#32165: Add pre-commit Hooks
-----------------------------+---------------------------------------------
Reporter: David Smith | Owner: David Smith
Type: New feature | Status: closed
Component: Packaging | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by Carlton Gibson <carlton@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"3bca95cca277a1e205c10d4fd3ea8527c6fcc34a" 3bca95cc]:
{{{
#!CommitTicketReference repository=""
revision="3bca95cca277a1e205c10d4fd3ea8527c6fcc34a"
Fixed #32165 -- Added pre-commit hooks

* Added pre-commit hooks for isort, flake8 and eslint
* Added documentation on how to install and use the tool
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32165#comment:5>

Django

unread,
Dec 23, 2020, 5:22:23 AM12/23/20
to django-...@googlegroups.com
#32165: Add pre-commit Hooks
-----------------------------+---------------------------------------------
Reporter: David Smith | Owner: David Smith
Type: New feature | Status: closed
Component: Packaging | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------

Comment (by Carlton Gibson):

In [changeset:"3a0ed0ce3f2e38c4336da6d68d901c6f3d5926dc" 3a0ed0ce]:

{{{
Refs #31265 -- Updated .eslintignore to match eslint tests
}}}

(Moved comment due to wrong ticket number)

--
Ticket URL: <https://code.djangoproject.com/ticket/32165#comment:6>

Django

unread,
Jan 19, 2021, 4:02:52 PM1/19/21
to django-...@googlegroups.com
#32165: Add pre-commit Hooks
-----------------------------+---------------------------------------------
Reporter: David Smith | Owner: David Smith
Type: New feature | Status: closed
Component: Packaging | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"dc2ddfe91a45386aceabef5b91936e55aaa47b44" dc2ddfe9]:
{{{
#!CommitTicketReference repository=""
revision="dc2ddfe91a45386aceabef5b91936e55aaa47b44"
Refs #32165 -- Bumped minimum ESLint version to 7.16.0 to match pre-commit
configuration.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32165#comment:7>

Reply all
Reply to author
Forward
0 new messages