This repository has been archived by the owner on Dec 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 122
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,11 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = 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,18 @@ | ||
#!/bin/bash | ||
|
||
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then | ||
exit 0; | ||
else | ||
gulp jshint &> /dev/null | ||
if [ "$?" != "0" ]; then | ||
echo "Found some JS errors. Check with 'gulp jshint' before committing." | ||
exit 1; | ||
fi | ||
|
||
gulp jscs &> /dev/null | ||
if [ "$?" != "0" ]; then | ||
echo "Unstyled JS. Check with 'gulp jscs' before committing." | ||
exit 1; | ||
fi | ||
fi | ||
|
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,26 @@ | ||
{ | ||
"requireCurlyBraces": ["for", "while", "do", "try", "catch"], | ||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], | ||
"requireSpacesInFunctionExpression": { | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"disallowMultipleVarDecl": "exceptUndefined", | ||
"requireSpacesInsideObjectBrackets": "allButNested", | ||
"disallowSpacesInsideArrayBrackets": true, | ||
"disallowSpacesInsideParentheses": true, | ||
"disallowSpaceAfterObjectKeys": true, | ||
"disallowQuotedKeysInObjects": true, | ||
"requireSpaceBeforeBinaryOperators": ["?", "+", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], | ||
"disallowSpaceAfterBinaryOperators": ["!"], | ||
"requireSpaceAfterBinaryOperators": ["?", ",", "+", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], | ||
"disallowSpaceBeforeBinaryOperators": [","], | ||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], | ||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], | ||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", "%"], | ||
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", "%"], | ||
"disallowImplicitTypeConversion": ["numeric", "binary", "string"], | ||
"disallowKeywords": ["with", "eval"], | ||
"disallowMultipleLineBreaks": true, | ||
"requireLineFeedAtFileEnd": true, | ||
"validateIndentation": 2 | ||
} |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good, but we're only checking code into branches and submitting PRs. Is there a way we can modify this to be useful for that case too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case you probably don't want it to run all the times, when intentionally committing a WIP code.
We could change the trigger so that it runs only if a commit message contains something like "pre-submit check", but you'll have to remember it.
Normally, for merging PR, this would be a job of a CI. Like Travis adding its info above the "merge" button so that you know it passed all checks/tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, so this hook is just a precaution for now, for a rare case where you happened to be on the
master
branch for some reason.