#22463 closed Cleanup/optimization (fixed)
Inconsistent code style in HTML, JavaScript, and CSS files
Reported by: | Trey Hunner | Owned by: | Trey Hunner |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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.
Change History (9)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 11 years ago
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.
comment:4 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|
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. See this django-dev thread for discussion.
comment:5 by , 10 years ago
Component: | Uncategorized → Documentation |
---|---|
Has patch: | set |
Needs documentation: | set |
comment:6 by , 9 years ago
Looks like there is new PR for this: https://github.com/django/django/pull/4577
I started a pull request for this ticket here: https://github.com/django/django/pull/2577