-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added code style rules to project & generated files [issue#26](//issu…
- Loading branch information
1 parent
2eca8de
commit 97d59f8
Showing
61 changed files
with
2,195 additions
and
1,660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"excludeFiles": [ | ||
"node_modules/**", | ||
"bower_components/**" | ||
], | ||
"requireCurlyBraces": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"try", | ||
"catch" | ||
], | ||
"requireCamelCaseOrUpperCaseIdentifiers": true, | ||
"maximumLineLength": 120, | ||
"validateIndentation": 2, | ||
"validateQuoteMarks": "'", | ||
"disallowMultipleLineStrings": true, | ||
"disallowMixedSpacesAndTabs": true, | ||
"disallowTrailingWhitespace": true, | ||
"disallowSpaceAfterPrefixUnaryOperators": true, | ||
"disallowSpacesInFunctionDeclaration": { | ||
"beforeOpeningRoundBrace": true, | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"disallowSpacesInAnonymousFunctionExpression": { | ||
"beforeOpeningRoundBrace": true, | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"disallowMultipleVarDecl": null, | ||
"requireSpaceAfterKeywords": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"return", | ||
"try", | ||
"catch" | ||
], | ||
"requireSpaceBeforeBinaryOperators": [ | ||
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", | ||
"&=", "|=", "^=", "+=", | ||
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&", | ||
"|", "^", "&&", "||", "===", "==", ">=", | ||
"<=", "<", ">", "!=", "!==" | ||
], | ||
"requireSpaceAfterLineComment": true, | ||
"requireSpaceAfterBinaryOperators": true, | ||
"requireSpacesInConditionalExpression": true, | ||
"requireSpaceBeforeBlockStatements": false, | ||
"requireLineFeedAtFileEnd": true, | ||
"disallowSpacesInsideObjectBrackets": "all", | ||
"disallowSpacesInsideArrayBrackets": false, | ||
"disallowSpacesInsideParentheses": true, | ||
"jsDoc": { | ||
"checkAnnotations": true, | ||
"checkParamNames": true, | ||
"requireParamTypes": true, | ||
"checkReturnTypes": true, | ||
"checkTypes": true | ||
}, | ||
"disallowMultipleLineBreaks": false, | ||
"disallowCommaBeforeLineBreak": null, | ||
"disallowDanglingUnderscores": null, | ||
"disallowEmptyBlocks": null, | ||
"disallowTrailingComma": null, | ||
"requireCommaBeforeLineBreak": null, | ||
"requireDotNotation": null, | ||
"requireMultipleVarDecl": null, | ||
"requireParenthesesAroundIIFE": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"es3": false, | ||
"forin": true, | ||
"freeze": true, | ||
"immed": true, | ||
"indent": 2, | ||
"latedef": "nofunc", | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": true, | ||
"nonbsp": true, | ||
"nonew": true, | ||
"plusplus": false, | ||
"quotmark": "single", | ||
"undef": true, | ||
"unused": false, | ||
"strict": false, | ||
"maxparams": 10, | ||
"maxdepth": 5, | ||
"maxstatements": 40, | ||
"maxcomplexity": 8, | ||
"maxlen": 120, | ||
"asi": false, | ||
"boss": false, | ||
"debug": false, | ||
"eqnull": true, | ||
"esnext": false, | ||
"evil": false, | ||
"expr": false, | ||
"funcscope": false, | ||
"globalstrict": false, | ||
"iterator": false, | ||
"lastsemic": false, | ||
"laxbreak": true, | ||
"laxcomma": true, | ||
"loopfunc": true, | ||
"maxerr": 50, | ||
"moz": false, | ||
"multistr": false, | ||
"notypeof": false, | ||
"proto": false, | ||
"scripturl": false, | ||
"shadow": false, | ||
"sub": true, | ||
"supernew": false, | ||
"validthis": false, | ||
"noyield": false, | ||
"browser": true, | ||
"node": true, | ||
"globals": { | ||
// vendors | ||
"angular": false, | ||
"jQuery": false, | ||
"Office": false, | ||
"app": false, | ||
// tests | ||
"describe": false, | ||
"it": false, | ||
"beforeEach": false, | ||
"afterEach": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Coding Conventions & Gudelines | ||
|
||
Refer to the existing code & tests for examples of coding guidelines for this project. | ||
|
||
All code must pass the [JSHint](http://www.jshint.com) & [JSCS](http://jscs.info) rules defined in this project which are defined in the following config files: | ||
|
||
- JSHint Settings: [.jshintrc](../.jshint) | ||
- JSCS Settings: [.jscsrc](../.jscsrc) | ||
|
||
## Coding Style | ||
|
||
Check all source files to ensure they meet these guidelines using the provided gulp task **vet**: | ||
|
||
``` | ||
$ gulp vet | ||
``` | ||
|
||
While coding, you can automatically run this using the **autovet** task: | ||
|
||
``` | ||
$ gulp autovet | ||
``` | ||
|
||
To simplify the task of formatting your code, you can use the **JSCS** command line NPM module provided in the developer dependencies. This does not do all code fixes, just the things that can be automatically fixed by the JSCS CLI | ||
|
||
``` | ||
$ node_modules/jscs/bin/jscs [path-to-js-files] --fix | ||
``` | ||
|
||
You can also pass multiple files in using the following: | ||
|
||
``` | ||
$ node_modules/jscs/bin/jscs test/taskpane/*.js --fix | ||
``` | ||
|
||
## Testing | ||
|
||
- All code must have valid, **passing** unit tests | ||
- All code should have 100% test coverage or good reasons why it doesn't meet 100% coverage | ||
|
||
Run all tests using the provided gulp task **test**: | ||
|
||
``` | ||
$ gulp test | ||
``` | ||
|
||
While coding, you can automatically run this using the **autotest** task: | ||
|
||
``` | ||
$ gulp autotest | ||
``` | ||
|
||
To generate a code coverage report, after running tests, open the [code coverage report](../coverage/lcov-report/index.html) in a browser. | ||
|
||
## Documentation | ||
|
||
- All non-trival functions should have a [jsdoc](http://usejsdoc.org/) description |
Oops, something went wrong.