[Django] #22463: Inconsistent code style in HTML, JavaScript, and CSS files

63 views
Skip to first unread message

Django

unread,
Apr 16, 2014, 3:32:08 PM4/16/14
to django-...@googlegroups.com
#22463: Inconsistent code style in HTML, JavaScript, and CSS files
--------------------------------------+--------------------
Reporter: treyhunner | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
There are multiple inconsistent code styles used throughout the Django
project.

It appears that the overall preferred style for HTML is 2 spaces,
JavaScript is 2 or 4 spaces (and sometimes tabs) and CSS is 4 spaces.

It seems that all files should have newlines at the end and whitespace
should be trimmed from the end of each line.

I am currently working on discovering the existing code style, fixing
obvious unintended inconsistencies, and creating a .editorconfig file to
document the expectations for future code changes.

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

Django

unread,
Apr 16, 2014, 4:19:52 PM4/16/14
to django-...@googlegroups.com
#22463: Inconsistent code style in HTML, JavaScript, and CSS files
-------------------------------------+-------------------------------------
Reporter: treyhunner | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Uncategorized | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by treyhunner):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

I started a pull request for this ticket here:
https://github.com/django/django/pull/2577

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

Django

unread,
Apr 16, 2014, 4:38:52 PM4/16/14
to django-...@googlegroups.com
#22463: Inconsistent code style in HTML, JavaScript, and CSS files
-------------------------------------+-------------------------------------
Reporter: treyhunner | Owner:
Type: | treyhunner
Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
Has patch: 0 | Unreviewed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0

| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by treyhunner):

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


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

Django

unread,
Apr 16, 2014, 5:34:08 PM4/16/14
to django-...@googlegroups.com
#22463: Inconsistent code style in HTML, JavaScript, and CSS files
-------------------------------------+-------------------------------------
Reporter: treyhunner | Owner:
Type: | treyhunner
Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage:
Has patch: 0 | Unreviewed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by treyhunner):

I added a (nearly empty) .jshintrc file to the pull request. The
preferred code style should be decided (I prefer the default JSHint style)
and the existing code should be modified to adhere to the style.

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

Django

unread,
Apr 16, 2014, 9:12:01 PM4/16/14
to django-...@googlegroups.com
#22463: Inconsistent code style in HTML, JavaScript, and CSS files
-------------------------------------+-------------------------------------
Reporter: treyhunner | Owner:
Type: | treyhunner
Cleanup/optimization | Status: assigned
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by russellm):

* stage: Unreviewed => Accepted


Comment:

Accepted on the principle that we Flake8 our Python code; linting our
JavaScript would also seem prudent. The only decision is the choice of
linter. [https://groups.google.com/d/msgid/django-
developers/CACuWcAwrCq_q4%2BFkKOVU5nqokSSgM7wqzXPbo%2BKJh0U%3DY1ecVA%40mail.gmail.com?utm_medium=email&utm_source=footer
See this django-dev thread for discussion].

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

Django

unread,
Aug 29, 2014, 8:16:31 AM8/29/14
to django-...@googlegroups.com
#22463: Inconsistent code style in HTML, JavaScript, and CSS files
-------------------------------------+-------------------------------------
Reporter: treyhunner | Owner:
Type: | treyhunner
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_docs: 0 => 1
* has_patch: 0 => 1
* component: Uncategorized => Documentation


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

Django

unread,
Jun 6, 2015, 5:22:46 PM6/6/15
to django-...@googlegroups.com
#22463: Inconsistent code style in HTML, JavaScript, and CSS files
-------------------------------------+-------------------------------------
Reporter: treyhunner | Owner:
Type: | treyhunner
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by oinopion):

Looks like there is new PR for this:
https://github.com/django/django/pull/4577

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

Django

unread,
Jun 27, 2015, 4:58:18 PM6/27/15
to django-...@googlegroups.com
#22463: Inconsistent code style in HTML, JavaScript, and CSS files
-------------------------------------+-------------------------------------
Reporter: treyhunner | Owner:
Type: | treyhunner
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"ec4f219ecb7a5e43d0353633fac4dac42d0ee492" ec4f219]:
{{{
#!CommitTicketReference repository=""
revision="ec4f219ecb7a5e43d0353633fac4dac42d0ee492"
Fixed #22463 -- Added code style guide and JavaScript linting
(EditorConfig and ESLint)
}}}

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

Django

unread,
Apr 20, 2020, 4:53:12 AM4/20/20
to django-...@googlegroups.com
#22463: Inconsistent code style in HTML, JavaScript, and CSS files
-------------------------------------+-------------------------------------
Reporter: Trey Hunner | Owner: Trey
Type: | Hunner

Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"7b4bd2a82c4709a9078fed5c33fa94f208a8c41e" 7b4bd2a8]:
{{{
#!CommitTicketReference repository=""
revision="7b4bd2a82c4709a9078fed5c33fa94f208a8c41e"
Refs #22463 -- Replaced JSHint with ESLint in contributing docs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22463#comment:8>

Django

unread,
Apr 20, 2020, 4:54:16 AM4/20/20
to django-...@googlegroups.com
#22463: Inconsistent code style in HTML, JavaScript, and CSS files
-------------------------------------+-------------------------------------
Reporter: Trey Hunner | Owner: Trey
Type: | Hunner
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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

In [changeset:"abe33c169520d5baa96cc9f6a5ea079fd58e9c38" abe33c16]:
{{{
#!CommitTicketReference repository=""
revision="abe33c169520d5baa96cc9f6a5ea079fd58e9c38"
[3.0.x] Refs #22463 -- Replaced JSHint with ESLint in contributing docs.

Backport of 7b4bd2a82c4709a9078fed5c33fa94f208a8c41e from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22463#comment:9>

Reply all
Reply to author
Forward
0 new messages