[Django] #30620: Code example in documentation not PEP8 compliant

7 views
Skip to first unread message

Django

unread,
Jul 6, 2019, 1:43:20 PM7/6/19
to django-...@googlegroups.com
#30620: Code example in documentation not PEP8 compliant
-------------------------------------+-------------------------------------
Reporter: nunoh | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: | Version: 2.2
Documentation |
Severity: Normal | Keywords: documentation PEP8
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
This is the smallest of issues, but nevertheless here it goes:

There's one line break missing at line
https://github.com/django/django/blob/master/docs/topics/auth/customizing.txt#L1172,
so that the example code is PEP8 compliant.

I would be happy to submit my very first PR if that's ok.

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

Django

unread,
Jul 7, 2019, 5:10:17 AM7/7/19
to django-...@googlegroups.com
#30620: A full example in documentation is not PEP8 compliant.
--------------------------------------+------------------------------------
Reporter: Nuno | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: documentation PEP8 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

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

* version: 2.2 => master
* stage: Unreviewed => Accepted


Comment:

Thanks for this report. Normally we don't restrict all PEP8 rules in
examples, e.g. in most of cases we don't put 2 blank lines before class
definition. In this case we have a full example that can be copy & paste,
so we can make it PEP8 compliant, for that please fix also
`add_fieldsets`:
{{{
diff --git a/docs/topics/auth/customizing.txt
b/docs/topics/auth/customizing.txt
index daec10c28e..7d287051d8 100644
--- a/docs/topics/auth/customizing.txt
+++ b/docs/topics/auth/customizing.txt
@@ -1162,13 +1162,14 @@ code would be required in the app's ``admin.py``
file::
add_fieldsets = (
(None, {
'classes': ('wide',),
- 'fields': ('email', 'date_of_birth', 'password1',
'password2')}
- ),
+ 'fields': ('email', 'date_of_birth', 'password1',
'password2'),
+ }),
)
search_fields = ('email',)
ordering = ('email',)
filter_horizontal = ()
}}}

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

Django

unread,
Jul 7, 2019, 5:11:27 AM7/7/19
to django-...@googlegroups.com
#30620: A full example in documentation is not PEP8 compliant.
--------------------------------------+------------------------------------
Reporter: Nuno | Owner: Nuno
Type: Cleanup/optimization | Status: assigned

Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: documentation PEP8 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

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

* status: new => assigned
* owner: nobody => Nuno


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

Django

unread,
Jul 7, 2019, 2:35:29 PM7/7/19
to django-...@googlegroups.com
#30620: A full example in documentation is not PEP8 compliant.
--------------------------------------+------------------------------------
Reporter: Nuno | Owner: Nuno
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: documentation PEP8 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


Comment:

Submitted PR in Github.

Link: [https://github.com/django/django/pull/11544 PR]

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

Django

unread,
Jul 8, 2019, 1:40:49 AM7/8/19
to django-...@googlegroups.com
#30620: A full example in documentation is not PEP8 compliant.
--------------------------------------+------------------------------------
Reporter: Nuno | Owner: Nuno
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: documentation PEP8 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"34a88b21dae71a26a9b136b599e5cbcf817eae16" 34a88b21]:
{{{
#!CommitTicketReference repository=""
revision="34a88b21dae71a26a9b136b599e5cbcf817eae16"
Fixed #30620 -- Made an example of admin-compliant custom user app pep8
compliant.
}}}

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

Reply all
Reply to author
Forward
0 new messages