Skip to content

Commit

Permalink
Add misspell to the lint script.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwilkie committed Mar 23, 2016
1 parent f26a5b2 commit b377e46
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions lint
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set -e

IGNORE_LINT_COMMENT=
IGNORE_TEST_PACKAGES=
IGNORE_SPELLINGS=
while true; do
case "$1" in
-nocomment)
Expand All @@ -25,6 +26,10 @@ while true; do
IGNORE_TEST_PACKAGES=1
shift 1
;;
-ignorespelling)
IGNORE_SPELLINGS="$2,$IGNORE_SPELLINGS"
shift 2
;;
*)
break
esac
Expand All @@ -35,8 +40,21 @@ function spell_check {
filename="$1"
local lint_result=0

if grep -iH --color=always 'psueod\|availible\|reciept' "${filename}"; then
echo "${filename}: spelling mistake"
# we don't want to spell check tar balls or binaries
if file $filename | grep executable >/dev/null 2>&1; then
return $lint_result
fi
if [[ $filename == *".tar" ]]; then
return $lint_result
fi

# misspell is completely optional. If you don't like it
# don't have it installed.
if ! type misspell >/dev/null 2>&1; then
return $lint_result
fi

if misspell -i "$IGNORE_SPELLINGS" "${filename}"; then
lint_result=1
fi

Expand Down
2 changes: 1 addition & 1 deletion rebuild-image
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cached_image_rev() {
find $CACHEDIR -name "$SAVEDNAME-*" -type f | sed -n 's/^[^\-]*\-\([a-z0-9]*\).gz$/\1/p'
}

# Have there been any revision beween $1 and $2
# Have there been any revision between $1 and $2
has_changes() {
local rev1=$1
local rev2=$2
Expand Down

0 comments on commit b377e46

Please sign in to comment.