mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 20:07:06 +00:00
Squashed 'tools/' changes from 4b7d5c6..a3b18bf
a3b18bf Merge pull request #65 from weaveworks/fix-integration-tests ecb5602 Fix integration tests f9dcbf6 ... without tab (clearly not my day) a6215c3 Add break I forgot 0e6832d Remove incorrectly added tab eb26c68 Merge pull request #64 from weaveworks/remove-test-package-linting f088e83 Review feedback 2c6e83e Remove test package linting 2b3a1bb Merge pull request #62 from weaveworks/revert-61-test-defaults 8c3883a Revert "Make no-go-get the default, and don't assume -tags netgo" e75c226 Fix bug in GC of firewall rules. e49754e Merge pull request #51 from weaveworks/gc-firewall-rules 191f487 Add flag to enale/disable firewall rules' GC. 567905c Add GC of firewall rules for weave-net-tests to scheduler. 03119e1 Fix typo in GC of firewall rules. bbe3844 Fix regular expression for firewall rules. c5c23ce Pre-change refactoring: splitted gc_project function into smaller methods for better readability. ed5529f GC firewall rules ed8e757 Merge pull request #61 from weaveworks/test-defaults 57856e6 Merge pull request #56 from weaveworks/remove-wcloud dd5f3e6 Add -p flag to test, run test in parallel 62f6f94 Make no-go-get the default, and don't assume -tags netgo 8946588 Merge pull request #60 from weaveworks/2647-gc-weave-net-tests 4085df9 Scheduler now also garbage-collects VMs from weave-net-tests. d1a5e46 Remove wcloud cli tool git-subtree-dir: tools git-subtree-split: a3b18bfe932ddb8adaceb0adb2df35c579bf4ee4
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
set -e
|
||||
|
||||
IGNORE_LINT_COMMENT=
|
||||
IGNORE_TEST_PACKAGES=
|
||||
IGNORE_SPELLINGS=
|
||||
while true; do
|
||||
case "$1" in
|
||||
@@ -27,7 +26,7 @@ while true; do
|
||||
shift 1
|
||||
;;
|
||||
-notestpackage)
|
||||
IGNORE_TEST_PACKAGES=1
|
||||
# NOOP, still accepted for backwards compatibility
|
||||
shift 1
|
||||
;;
|
||||
-ignorespelling)
|
||||
@@ -65,30 +64,6 @@ spell_check() {
|
||||
return $lint_result
|
||||
}
|
||||
|
||||
test_mismatch() {
|
||||
local filename="$1"
|
||||
local package=$(grep '^package ' "$filename" | awk '{print $2}')
|
||||
local lint_result=0
|
||||
|
||||
if [[ $package == "main" ]]; then
|
||||
return # in package main, all bets are off
|
||||
fi
|
||||
|
||||
if [[ $filename == *"_internal_test.go" ]]; then
|
||||
if [[ $package == *"_test" ]]; then
|
||||
lint_result=1
|
||||
echo "${filename}: should not be part of a _test package"
|
||||
fi
|
||||
else
|
||||
if [[ ! $package == *"_test" ]]; then
|
||||
lint_result=1
|
||||
echo "${filename}: should be part of a _test package"
|
||||
fi
|
||||
fi
|
||||
|
||||
return $lint_result
|
||||
}
|
||||
|
||||
lint_go() {
|
||||
local filename="$1"
|
||||
local lint_result=0
|
||||
@@ -183,12 +158,6 @@ lint() {
|
||||
tf) lint_tf "${filename}" || lint_result=1 ;;
|
||||
esac
|
||||
|
||||
if [ -z "$IGNORE_TEST_PACKAGES" ]; then
|
||||
if [[ "$filename" == *"_test.go" ]]; then
|
||||
test_mismatch "${filename}" || lint_result=1
|
||||
fi
|
||||
fi
|
||||
|
||||
spell_check "${filename}" || lint_result=1
|
||||
|
||||
return $lint_result
|
||||
|
||||
Reference in New Issue
Block a user