Skip to content

Updated the code to use spaces instead of tabs with a space indentation of 4 spaces#65

Merged
hppycoder merged 2 commits into
agrublev:masterfrom
hppycoder:master-whitespaceJshint
Jan 30, 2015
Merged

Updated the code to use spaces instead of tabs with a space indentation of 4 spaces#65
hppycoder merged 2 commits into
agrublev:masterfrom
hppycoder:master-whitespaceJshint

Conversation

@hppycoder

Copy link
Copy Markdown
Collaborator

Updated the code to use spaces instead of tabs, and added a jshint file to help additional collaboration efforts.

Code was untouched, starts a discussion about the change from tabs to spaces and implementing a jshint file.

…per indentation. Added a jshint file to validate against.
@hppycoder

Copy link
Copy Markdown
Collaborator Author

Looking at the code guidelines for the angular project their .jshintrc file is a spacing of 2. Its also the default spacing for the angular yeoman generator. I will update this PR with those rules. Any other collaborators are free to comment.

@panuhorsmalahti

Copy link
Copy Markdown
Collaborator

The default spacing is 4 with jshint and jslint:
https://github.com/jshint/jshint/blob/master/examples/.jshintrc#L15
http://www.jslint.com/lint.html#options

Two spaces seem to be more common (unfortunately):
http://atroche.org/post/30994290348/javascript-indentation

@hppycoder

Copy link
Copy Markdown
Collaborator Author

@panuhorsmalahti - That's correct the default .jshintrc is set to 4 spaces. That's why the PR above is set to 4. Looking at this: https://github.com/angular/angular.js/blob/master/.jshintrc-base shows that the developers behind the core of which this service is built is using 2. I think that we should be using 2 as it is more common, and it's also what the core developers behind the framework uses.

@hppycoder

Copy link
Copy Markdown
Collaborator Author

@aaunel @agrublev @voronianski - Do you three have any say in this? The code will use 2 spaces (not tabs) for indentation and the .jshintrc file reflects the same that is used for the core AngularJS project.

@voronianski

Copy link
Copy Markdown
Collaborator

@hppycoder personally I don't like 2 spaces indentation.. but I'm not often committing there so it's up to you.

@hppycoder

Copy link
Copy Markdown
Collaborator Author

I like the 2 spaces, it's what AngularJS uses, it's what comes default with most IDEs, and most of the ones who use .jshintrc are using. I think I will merge this, if we hate it we can always change it.

hppycoder added a commit that referenced this pull request Jan 30, 2015
Updated the code to use spaces instead of tabs with a space indentation of 2 spaces
@hppycoder
hppycoder merged commit e4e8316 into agrublev:master Jan 30, 2015
@hppycoder
hppycoder deleted the master-whitespaceJshint branch January 30, 2015 14:31
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.

3 participants