Commit 7e29afac authored by Sam Saccone's avatar Sam Saccone

run jscs over changes to examples

parent 6eb745d2
/node_modules /node_modules
/bower_components /bower_components
/dist /dist
/tooling/node_modules
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
"function", "function",
"typeof" "typeof"
], ],
"excludeFiles": ["**/node_modules/**", "**/bower_components/**"],
"requireSpaceBeforeBlockStatements": true, "requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true, "requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true, "requireSpacesInConditionalExpression": true,
......
#!/bin/bash
npm i && \
eval "npm test -- $@"
{
"private": true,
"scripts": {
"lint": "jscs"
},
"dependencies": {
"jscs": "^1.13.1"
}
}
#!/bin/bash
PATHS=""
EXAMPLES_DIR="../examples/"
for arg in "$@"
do
case $arg in
--framework=*)
PATHS+=" "$EXAMPLES_DIR$(echo $arg | awk '{split($0,a,"="); print a[2]}')
;;
esac
done
npm i && \
eval "npm run lint -- -c ../.jscsrc $PATHS"
#!/bin/bash #!/bin/bash
set -o pipefail set -o pipefail
get_changes ()
{
git remote add current https://github.com/tastejs/todomvc.git && \
git fetch --quiet current && \
git diff HEAD origin/master --name-only | awk 'BEGIN {FS = "/"}; {print $1 "/" $2 "/" $3}' | uniq | grep -v \/\/ | grep examples | awk -F '[/]' '{print "--framework=" $2}'
}
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]
then then
git submodule add -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} site > /dev/null 2>&1 git submodule add -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} site > /dev/null 2>&1
...@@ -16,17 +24,16 @@ then ...@@ -16,17 +24,16 @@ then
# Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null to not expose your oauth token # Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null to not expose your oauth token
git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages > /dev/null 2>&1 git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages > /dev/null 2>&1
else else
git remote add current https://github.com/tastejs/todomvc.git && \ changes=$(get_changes)
git fetch current && \
cd browser-tests/ && \
npm i && \
changes=$(git diff HEAD origin/master --name-only | awk 'BEGIN {FS = "/"}; {print $1 "/" $2 "/" $3}' | uniq | grep -v \/\/ | grep examples | awk -F '[/]' '{print "--framework=" $2}')
if [ "${#changes}" = 0 ] if [ "${#changes}" = 0 ]
then then
exit 0 exit 0
else else
echo changes | xargs npm run test -- cd tooling && \
echo $changes | xargs ./run.sh && \
cd ../browser-tests && \
echo $changes | xargs ./run.sh
fi fi
exit $? exit $?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment