mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
Squashed 'tools/' changes from c342e83..f9aa081
f9aa081Correctly fail when spelling mistakes are found.f8950edMerge pull request #19 from weaveworks/18-misspellb377e46Add misspell to the lint script.f26a5b2Merge pull request #20 from weaveworks/socks-updatef904203Update socks proxy for upstream changes.495e875Add reciept to spellchecker git-subtree-dir: tools git-subtree-split:f9aa081666
This commit is contained in:
22
lint
22
lint
@@ -15,6 +15,7 @@ set -e
|
||||
|
||||
IGNORE_LINT_COMMENT=
|
||||
IGNORE_TEST_PACKAGES=
|
||||
IGNORE_SPELLINGS=
|
||||
while true; do
|
||||
case "$1" in
|
||||
-nocomment)
|
||||
@@ -25,6 +26,10 @@ while true; do
|
||||
IGNORE_TEST_PACKAGES=1
|
||||
shift 1
|
||||
;;
|
||||
-ignorespelling)
|
||||
IGNORE_SPELLINGS="$2,$IGNORE_SPELLINGS"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
break
|
||||
esac
|
||||
@@ -35,8 +40,21 @@ function spell_check {
|
||||
filename="$1"
|
||||
local lint_result=0
|
||||
|
||||
if grep -iH --color=always 'psueod\|availible' "${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 -error -i "$IGNORE_SPELLINGS" "${filename}"; then
|
||||
lint_result=1
|
||||
fi
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
socks5 "github.com/armon/go-socks5"
|
||||
"github.com/docker/docker/pkg/mflag"
|
||||
"github.com/weaveworks/weave/common/mflagext"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type pacFileParameters struct {
|
||||
@@ -72,11 +73,11 @@ type aliasingResolver struct {
|
||||
socks5.NameResolver
|
||||
}
|
||||
|
||||
func (r aliasingResolver) Resolve(name string) (net.IP, error) {
|
||||
func (r aliasingResolver) Resolve(ctx context.Context, name string) (context.Context, net.IP, error) {
|
||||
if alias, ok := r.aliases[name]; ok {
|
||||
return r.NameResolver.Resolve(alias)
|
||||
return r.NameResolver.Resolve(ctx, alias)
|
||||
}
|
||||
return r.NameResolver.Resolve(name)
|
||||
return r.NameResolver.Resolve(ctx, name)
|
||||
}
|
||||
|
||||
func socksProxy(aliases map[string]string) {
|
||||
|
||||
Reference in New Issue
Block a user