Skip to content

Commit

Permalink
js codestyle check for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
jmleroux committed Jun 16, 2015
1 parent 779837e commit 3c81a87
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ uploads_test/
.phpspec/*.tpl
composer.lock
.php_cs.cache
node_modules/
71 changes: 71 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpaceBeforeBinaryOperators": [
","
],
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"disallowKeywords": [
"with"
],
"disallowKeywordsOnNewLine": [
"else"
],
"disallowMultipleLineBreaks": true,
"disallowMultipleLineStrings": true,
"disallowMultipleVarDecl": true,
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"requireBlocksOnNewline": true,
"requireCommaBeforeLineBreak": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceAfterBinaryOperators": true,
// "requireCamelCaseOrUpperCaseIdentifiers": true,
"requireLineFeedAtFileEnd": true,
"requireCapitalizedConstructors": true,
"requireDotNotation": true,
"requireSpacesInForStatement": true,
"requireSpaceBetweenArguments": true,
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"case",
"return",
"try",
"catch",
"function",
"typeof"
],
"requireSpaceBeforeObjectValues": true,
"safeContextKeyword": ["_this", "self"],
"validateLineBreaks": "LF",
"validateQuoteMarks": "'",
"validateIndentation": 4,
"maximumLineLength": 120
}
21 changes: 21 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"bitwise": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"nonew": true,
"quotmark": true,
"undef": true,
"unused": true,
"maxlen": 120,
"globalstrict": true,
"browser": true,
"globals": {
"Translator": true,
"require": true,
"define": true
}
}
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ before_script:
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then composer require --no-update doctrine/mongodb-odm v1.0.0-beta12@dev; fi;'
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then composer require --no-update doctrine/mongodb-odm-bundle v3.0.0-BETA6@dev; fi;'
- composer update --prefer-dist --no-scripts --no-interaction
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then composer update --prefer-dist --no-interaction; else composer update --prefer-dist --no-interaction --no-scripts; fi;'
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./app/console oro:requirejs:generate-config; fi;'
- npm install -g grunt-cli
- npm install
- curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer

script:
- ./bin/phpunit -c app/phpunit.travis.xml --testsuite PIM_Unit_Test
- ./phpspec-fix
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php php-cs-fixer fix --dry-run -v --diff --config-file=.php_cs.php; fi;'
- ./app/Resources/jenkins/interface_check.sh src/
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then grunt travis; else grunt codestyle; fi;'

notifications:
slack: akeneo:fDZaQeRRj1gVtXCW3f2kQAxo

0 comments on commit 3c81a87

Please sign in to comment.