mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 10:41:14 +00:00
Add misspell to the lint script.
This commit is contained in:
22
lint
22
lint
@@ -15,6 +15,7 @@ set -e
|
|||||||
|
|
||||||
IGNORE_LINT_COMMENT=
|
IGNORE_LINT_COMMENT=
|
||||||
IGNORE_TEST_PACKAGES=
|
IGNORE_TEST_PACKAGES=
|
||||||
|
IGNORE_SPELLINGS=
|
||||||
while true; do
|
while true; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-nocomment)
|
-nocomment)
|
||||||
@@ -24,6 +25,10 @@ while true; do
|
|||||||
-notestpackage)
|
-notestpackage)
|
||||||
IGNORE_TEST_PACKAGES=1
|
IGNORE_TEST_PACKAGES=1
|
||||||
shift 1
|
shift 1
|
||||||
|
;;
|
||||||
|
-ignorespelling)
|
||||||
|
IGNORE_SPELLINGS="$2,$IGNORE_SPELLINGS"
|
||||||
|
shift 2
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
break
|
break
|
||||||
@@ -35,8 +40,21 @@ function spell_check {
|
|||||||
filename="$1"
|
filename="$1"
|
||||||
local lint_result=0
|
local lint_result=0
|
||||||
|
|
||||||
if grep -iH --color=always 'psueod\|availible\|reciept' "${filename}"; then
|
# we don't want to spell check tar balls or binaries
|
||||||
echo "${filename}: spelling mistake"
|
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
|
lint_result=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ cached_image_rev() {
|
|||||||
find $CACHEDIR -name "$SAVEDNAME-*" -type f | sed -n 's/^[^\-]*\-\([a-z0-9]*\).gz$/\1/p'
|
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() {
|
has_changes() {
|
||||||
local rev1=$1
|
local rev1=$1
|
||||||
local rev2=$2
|
local rev2=$2
|
||||||
|
|||||||
Reference in New Issue
Block a user