-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
117 additions
and
0 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,14 @@ | ||
#!/bin/bash | ||
|
||
CHANGED_JS_FILES=`git diff --cached --name-only | grep -E "^static/js/.*.js" | grep -v .min.js` | ||
|
||
if [ -n "$CHANGED_JS_FILES" ]; then | ||
echo "Checking Javascript for the following files:" | ||
echo $CHANGED_JS_FILES | ||
|
||
if ! jscs $CHANGED_JS_FILES; then | ||
echo "Javascript issues detected; commit aborted." | ||
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,17 @@ | ||
#!/bin/bash | ||
|
||
CHANGED_PYTHON_FILES=`git diff --cached --name-only | grep py$` | ||
|
||
if [ -n "$CHANGED_PYTHON_FILES" ]; then | ||
CHANGED_FILES=`echo $CHANGED_PYTHON_FILES | tr '\n ' ,` | ||
|
||
if ! [ -z "echo $CHANGED_FILES | sed -e 's/^[ \t]*//'" ]; then | ||
echo "Checking PEP-8 Compliance for the following files:" | ||
printf "$CHANGED_PYTHON_FILES\n" | ||
if ! pep8 --filename=$CHANGED_FILES; then | ||
echo "PEP-8 errors detected; commit aborted." | ||
exit 1 | ||
fi | ||
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,25 @@ | ||
#!/bin/bash | ||
|
||
# Update Filters | ||
git config filter.sass.clean "sed '/^@media -sass-debug-info/ d'" | ||
git config filter.sass.smudge cat | ||
|
||
git config filter.css.clean "css-beautify --end_with_newline --file -" | ||
git config filter.css.smudge cat | ||
|
||
git config filter.js.clean "js-beautify --space-after-anon-function --brace-style=end-expand --preserve-newlines --end_with_newline --file -" | ||
git config filter.js.smudge cat | ||
|
||
git config filter.noop.clean cat | ||
git config filter.noop.smudge cat | ||
|
||
git config filter.xml.clean "xmllint --format -" | ||
git config filter.xml.smudge cat | ||
|
||
# Install hooks | ||
cp git_config/hooks/post-checkout .git/hooks | ||
cp git_config/hooks/pre-commit .git/hooks | ||
|
||
if [ -f git_config/hooks/post-checkout-user ]; then | ||
cat git_config/hooks/post-checkout-user >> .git/hooks/post-checkout | ||
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,52 @@ | ||
#!/bin/sh | ||
|
||
if [ -f git_config/configure.sh ]; then | ||
sh git_config/configure.sh | ||
fi | ||
|
||
echo "Deleting *.pyc files" | ||
find app -name "*.pyc" -type f | xargs rm | ||
|
||
MIGRATION_CHANGES=`git diff --name-status $1..$2 app/migrations/` | ||
if ! [ -z "$MIGRATION_CHANGES" ]; then | ||
echo "The database schema has changed since the previous checkout. You may need to migrate the database to avoid data consistency issues." | ||
echo "" | ||
printf "$MIGRATION_CHANGES\n" | ||
echo "" | ||
fi | ||
|
||
# Check if the requirements file has been updated. | ||
REQUIREMENTS_UPDATE=`git diff --name-only $1..$2 requirements.txt` | ||
if ! [ -z "$REQUIREMENTS_UPDATE" ]; then | ||
echo "Requirements have changed since the previous checkout." | ||
echo "" | ||
pip install -qr requirements.txt | ||
fi | ||
|
||
# Check if NPM modules have been updated. | ||
JS_UPDATE=`git diff --name-only $1..$2 package.json` | ||
if ! [ -z "$JS_UPDATE" ]; then | ||
echo "NPM modules have changed since the previous checkout." | ||
echo "" | ||
npm install | ||
fi | ||
|
||
# Check if gems have been updated. | ||
GEM_UPDATE=`git diff --name-only $1..$2 Gemfile` | ||
if ! [ -z "$GEM_UPDATE" ]; then | ||
echo "Gems have changed since the previous checkout." | ||
echo "" | ||
bundle install | ||
fi | ||
|
||
if ! hash js-beautify; then | ||
echo "Installing js-beautify." | ||
echo "" | ||
npm install js-beautify -g | ||
fi | ||
|
||
if ! hash jscs; then | ||
echo "Installing jscs." | ||
echo "" | ||
npm install jscs -g | ||
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,9 @@ | ||
#!/bin/bash | ||
|
||
if [ -f git_config/configure.sh ]; then | ||
sh git_config/configure.sh | ||
else | ||
exit 1 | ||
fi | ||
|
||
git_config/check_pep8_compliance.sh |