Skip to content
Permalink
Browse files

fix prepare commit

  • Loading branch information
3nids committed Dec 15, 2016
1 parent 2ffe1a7 commit 1090e8b7da68d4668189c99f1123571a459a2e2e
Showing with 7 additions and 10 deletions.
  1. +2 −3 ci/travis/check_spelling.sh
  2. +4 −2 scripts/chkspelling_ag.sh
  3. +1 −5 scripts/prepare-commit.sh
@@ -11,7 +11,6 @@ if [[ ! -z $TRAVIS_PULL_REQUEST_BRANCH ]]; then
echo "TRAVIS PR BRANCH: $TRAVIS_PULL_REQUEST_BRANCH"
FILES=$(git diff --name-only HEAD $(git merge-base HEAD master) | tr '\n' ' ' )
fi


CODE=$(./scripts/chkspelling_ag.sh)
exit $CODE
./scripts/chkspelling_ag.sh $FILES

@@ -15,11 +15,13 @@
###########################################################################

# optional arguments: files to be checked
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

AGIGNORE=${DIR}/.agignore

RE=$(cut -d: -f1 scripts/spelling.dat | tr '\n' '\|' | sed -e 's/|$//')
if [ ! $# -eq 0 ]; then
EXCLUDE=$(cat ci/travis/.agignore | sed -e 's/\s*#.*$//' -e '/^\s*$/d' | tr '\n' '|' | sed -e 's/|$//')
EXCLUDE=$(cat $AGIGNORE | sed -e 's/\s*#.*$//' -e '/^\s*$/d' | tr '\n' '|' | sed -e 's/|$//')
FILES=$(echo $@ | tr -s '[[:blank:]]' '\n' | egrep -iv "$EXCLUDE" | tr '\n' ' ' )
echo "Running spell check on files: $FILES"
else
@@ -28,7 +30,7 @@ fi


exec 5>&1
OUTPUT=$(ag --smart-case --all-text --nopager --numbers --word-regexp --path-to-ignore scripts/.agignore "$RE" $FILES |tee /dev/fd/5)
OUTPUT=$(unbuffer ag --smart-case --all-text --nopager --numbers --word-regexp --path-to-ignore $AGIGNORE "$RE" $FILES |tee /dev/fd/5)


if [[ ! -z $OUTPUT ]]; then
@@ -41,11 +41,7 @@ set -e

# determine changed files
MODIFIED=$(git status --porcelain| sed -ne "s/^ *[MA] *//p" | sort -u)

CODE=$(./$TOPLEVEL/scripts/chkspelling_ag.sh $MODIFIED)
if [ code -eq 1]; then
exit 1
fi
${TOPLEVEL}/scripts/chkspelling_ag.sh $MODIFIED


if [ -z "$MODIFIED" ]; then

0 comments on commit 1090e8b

Please sign in to comment.
You can’t perform that action at this time.