Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EditorConfig file to blueprints #1507

Merged
merged 1 commit into from
Jul 28, 2014
Merged

Conversation

quaertym
Copy link
Contributor

As discussed in #1426, EditorConfig file is added to blueprints. I have set defaults for html, css, js and hbs files and they can be modified if needed. The default is 2 space indents for all of them. Please take a look.

cc @abuiles @treyhunner @ccoenen

stefanpenner added a commit that referenced this pull request Jul 28, 2014
Add EditorConfig file to blueprints
@stefanpenner stefanpenner merged commit 353fcca into ember-cli:master Jul 28, 2014
[*.html]
indent_style = space
indent_size = 2

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could be consolidated into one group like so:

[*.{js,hbs,css,html}]
indent_style = space
indent_size = 2

Keeping them in separate groups allows users to more easily override them individually, but I'm not sure how many people use separate indentation sizes for their HTML/HBS, CSS, and JS files.

Changing the number "2" four times isn't difficult so this is non an important issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am strongly opposed to this. I would assume that this layout was chosen to make customisation dead-simple. I, for one, welcome this.

My coding style for js would be indent_style=tab, so in the current layout that's a one-line change. I a condensed layout that would be more of a hassle.

(edited for more clarity)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ccoenen your argument makes sense to me. I wanted to bring it up in case section grouping wasn't known.

I always use the same indentation for my HTML, CSS, JS, and HBS. Changing 4 lines is easier for users than adding new sections.

@quaertym
Copy link
Contributor Author

This config is written to be easily customizable according to user preferences. 2 space indent is a good default since ember new generates files (app.js, app.css, index.html) with 2 space indentation. Indentation settings are also added for [*] to cover files other than js,css,hbs and html(e.g. *.json) and make it future proof for files like .scss if it is used by user but not added to editorconfig.

PR is already merged, so if someone comes up with a better config feel free to send a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants