Fix inconsistent style and add EditorConfig file #2577

Closed
wants to merge 5 commits into
from

Projects

None yet

3 participants

@treyhunner
Member

For ticket 22463.

I haven't yet analyzed the inconsistencies between final newlines in the JSON files.

Some more potential changes that could be made:

  • Change code style of JS files to all use 4 spaces for indentation
  • Explicitly list each code style (py, xml, js, rst, etc.) instead of using a * catch-all section
  • Analyze code in tests directory to determine whether some of the inconsistent files (json/xml/po files mostly) should be made consistent

You can confirm that this commit is purely a whitespace change (except for the addition of the .editorconfig file) by running git diff -w or using ?w=1 on Github.

Check http://editorconfig.org for more details on EditorConfig.

treyhunner added some commits Apr 16, 2014
@treyhunner treyhunner Add newlines to the ends of files missing them
Changes:
- Ensure all CSS files have a final newline
- Ensure all HTML files have a final newline
- Ensure all JavaScript files have a final newline
150f9be
@treyhunner treyhunner Remove tab indentation (use spaces) 2785b48
@treyhunner treyhunner Add EditorConfig file declaring current code style a6807f8
@treyhunner treyhunner Add a basic JSHint configuration file for JS code
Install jshint with:

    npm install -g jshint

Check code with:

    jshint .
8f4eaff
@ramiro

I'd simply ignore the .graffle files as they are machine-generated.

Owner

In the .graffle files will never be edited manually, I would just remove their reference from EditorConfig and treat them as if they were a binary file (note that .png and many other file types are not listed because they are binary).

Yes, that's what I meant. We are in agreement.

@treyhunner treyhunner referenced this pull request in django/deps May 5, 2014
Merged

Add DEP: JavaScript Tests #4

@timgraham
Member

I merged the newline/tab fixes. Are you still working on this? I think we should add documentation about the lint configs before we merge it.

@treyhunner
Member

@timgraham #3003 fixes most of the JS configuration so jshint works as expected. I made a branch that finishes the JS linting started by that pull request but I have not made a pull request for it: https://github.com/treyhunner/django/tree/fix-jshint-errors

@timgraham
Member

Okay, well I guess this PR (the editor config) cannot be merged as it is, so closing for now.

@timgraham timgraham closed this Nov 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment