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.
* 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>
* owner: nobody => treyhunner
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/22463#comment:2>
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>
* 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>
* needs_docs: 0 => 1
* has_patch: 0 => 1
* component: Uncategorized => Documentation
--
Ticket URL: <https://code.djangoproject.com/ticket/22463#comment:5>
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>
* 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>
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>
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>