diff --git a/CHANGELOG.md b/CHANGELOG.md
index 13baca042..2ee21a8d8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -274,7 +274,7 @@ Bug fixes:
[#686](https://github.com/weaveworks/scope/pull/686)
- Take default topology option if missing in URL
[#678](https://github.com/weaveworks/scope/pull/678)
-- Dont treat missing node as UI error
+- Don't treat missing node as UI error
[#677](https://github.com/weaveworks/scope/pull/677)
- Unset previous details when deselecting a node
[#675](https://github.com/weaveworks/scope/pull/675)
diff --git a/Makefile b/Makefile
index 36892fb5f..c59244636 100644
--- a/Makefile
+++ b/Makefile
@@ -100,7 +100,7 @@ tests: $(SCOPE_BACKEND_BUILD_UPTODATE)
./tools/test -no-go-get
lint: $(SCOPE_BACKEND_BUILD_UPTODATE)
- ./tools/lint .
+ ./tools/lint -ignorespelling "agre " -ignorespelling "AGRE " .
prog/static.go: $(SCOPE_BACKEND_BUILD_UPTODATE)
esc -o $@ -prefix client/build client/build
diff --git a/README.md b/README.md
index 1860ddeb2..d4a9f9731 100644
--- a/README.md
+++ b/README.md
@@ -116,7 +116,7 @@ You need to run Scope on every machine you want to monitor.
```
If you run Scope on the same machine as the Weave Network, the probe will use
-weaveDNS to automatically discover other apps on your network. Scope acheives
+weaveDNS to automatically discover other apps on your network. Scope achieves
this by registering itself under the address **scope.weave.local**. Each probe
will send reports to every app registered under this address. Therefore, if
you have a running weaveDNS setup, you do not need to take any further steps.
@@ -209,7 +209,7 @@ The SCOPE_SERVICE_TOKEN is found when you [log in to the Scope service](https://
- "--probe.docker"
- "true"
- "--service-token"
- - "${SCOPE_SERVICE_TOKEN}"
+ - "${SCOPE_SERVICE_TOKEN}"
## Using Weave Scope with Kubernetes
@@ -217,14 +217,14 @@ Scope comes with built-in Kubernetes support. We recommend to run Scope natively
in your Kubernetes cluster using
[these resource definitions](https://github.com/TheNewNormal/kube-charts/tree/master/weavescope/manifests).
-1. Make sure your cluster allows priviledged pods (required by the Scope
- probes). Priviledged pods are allowed by default from Kubernetes 1.1.
- If you are running an earlier version or a non-default configuration,
- make sure your API Server and all your Kubelets are provided with flag `--allow_privileged`
+1. Make sure your cluster allows privileged pods (required by the Scope
+ probes). Privileged pods are allowed by default from Kubernetes 1.1.
+ If you are running an earlier version or a non-default configuration,
+ make sure your API Server and all your Kubelets are provided with flag `--allow_privileged`
at launch time.
2. Make sure your cluster supports
- [DaemonSets](https://github.com/kubernetes/kubernetes/blob/master/docs/design/daemon.md).
+ [DaemonSets](https://github.com/kubernetes/kubernetes/blob/master/docs/design/daemon.md).
DaemonSets are needed to ensure that each Kubernetes node
runs a Scope Probe:
diff --git a/backend/Dockerfile b/backend/Dockerfile
index 566bb049e..b323a7128 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -1,10 +1,11 @@
FROM golang:1.6.0
-RUN apt-get update && apt-get install -y libpcap-dev python-requests time
+RUN apt-get update && apt-get install -y libpcap-dev python-requests time file
RUN go clean -i net && go install -tags netgo std && go install -race -tags netgo std
RUN go get -tags netgo \
github.com/fzipp/gocyclo \
github.com/golang/lint/golint \
github.com/kisielk/errcheck \
- github.com/mjibson/esc
+ github.com/mjibson/esc \
+ github.com/client9/misspell/cmd/misspell
COPY build.sh /
ENTRYPOINT ["/build.sh"]
diff --git a/client/Dockerfile b/client/Dockerfile
index 0f0dc20b6..bdb94e9e1 100644
--- a/client/Dockerfile
+++ b/client/Dockerfile
@@ -2,6 +2,6 @@ FROM node:4.2.2
WORKDIR /home/weave
COPY package.json /home/weave/
ENV NPM_CONFIG_LOGLEVEL=warn NPM_CONFIG_PROGRESS=false
-# Dont install optional developer tools
+# Don't install optional developer tools
RUN npm install --no-optional
COPY webpack.local.config.js webpack.production.config.js server.js .babelrc .eslintrc .eslintignore /home/weave/
diff --git a/client/app/scripts/actions/app-actions.js b/client/app/scripts/actions/app-actions.js
index 146422404..563046f88 100644
--- a/client/app/scripts/actions/app-actions.js
+++ b/client/app/scripts/actions/app-actions.js
@@ -189,7 +189,7 @@ export function hitEsc() {
pipeId: controlPipe.id
});
updateRoute();
- // Dont deselect node on ESC if there is a controlPipe (keep terminal open)
+ // Don't deselect node on ESC if there is a controlPipe (keep terminal open)
} else if (AppStore.getTopCardNodeId() && !controlPipe) {
AppDispatcher.dispatch({ type: ActionTypes.DESELECT_NODE });
updateRoute();
diff --git a/client/app/scripts/charts/__tests__/node-layout-test.js b/client/app/scripts/charts/__tests__/node-layout-test.js
index 088dd43f6..658380575 100644
--- a/client/app/scripts/charts/__tests__/node-layout-test.js
+++ b/client/app/scripts/charts/__tests__/node-layout-test.js
@@ -193,7 +193,7 @@ describe('NodesLayout', () => {
expect(resultCoords).toEqual(coords);
});
- it('keeps nodes in rectangle after node dissappears', () => {
+ it('keeps nodes in rectangle after node disappears', () => {
let result = NodesLayout.doLayout(
nodeSets.initial4.nodes,
nodeSets.initial4.edges);
diff --git a/client/app/scripts/charts/node.js b/client/app/scripts/charts/node.js
index b08b57ae9..927a05725 100644
--- a/client/app/scripts/charts/node.js
+++ b/client/app/scripts/charts/node.js
@@ -28,7 +28,7 @@ const nodeShapes = {
function getNodeShape({shape, stack}) {
const nodeShape = nodeShapes[shape];
if (!nodeShape) {
- throw new Error(`Unkown shape: ${shape}!`);
+ throw new Error(`Unknown shape: ${shape}!`);
}
return stack ? stackedShape(nodeShape) : nodeShape;
}
diff --git a/experimental/sniff/sniffer.go b/experimental/sniff/sniffer.go
index 8e6d8ecf1..4c6446a8a 100644
--- a/experimental/sniff/sniffer.go
+++ b/experimental/sniff/sniffer.go
@@ -147,7 +147,7 @@ func (s *Sniffer) loop(src gopacket.ZeroCopyPacketDataSource, on, off time.Durat
}
}
-// interpolateCounts compensates for sampling by artifically inflating counts
+// interpolateCounts compensates for sampling by artificially inflating counts
// throughout the report. It should be run once for each report, within the
// probe, before it gets emitted into the rest of the system.
func interpolateCounts(r report.Report) {
diff --git a/experimental/tracer/README.md b/experimental/tracer/README.md
index b2fb8ed7f..cba9e7f6f 100644
--- a/experimental/tracer/README.md
+++ b/experimental/tracer/README.md
@@ -8,7 +8,7 @@ Run tracer:
TODO:
- need to stich traces together
-- deal with persistant connections
+- deal with persistent connections
- make it work for goroutines
- test with jvm based app
- find way to get local ip address for an incoming connection
diff --git a/experimental/tracer/ptrace/ptracer.go b/experimental/tracer/ptrace/ptracer.go
index c0205b3f5..81fabad8e 100644
--- a/experimental/tracer/ptrace/ptracer.go
+++ b/experimental/tracer/ptrace/ptracer.go
@@ -238,7 +238,7 @@ func (t *PTracer) handleStopped(pid int, status syscall.WaitStatus) {
t.threadExited(target)
return
} else if status.Stopped() {
- // tracee recieved a non-trace related signal
+ // tracee received a non-trace related signal
signal = status.StopSignal()
if signal == syscall.SIGSTOP && target.process.detaching {
diff --git a/probe/docker/registry.go b/probe/docker/registry.go
index b9e63c8c6..962f22b26 100644
--- a/probe/docker/registry.go
+++ b/probe/docker/registry.go
@@ -132,7 +132,7 @@ func (r *registry) loop() {
func (r *registry) listenForEvents() bool {
// First we empty the store lists.
- // This ensure any containers that went away inbetween calls to
+ // This ensure any containers that went away in between calls to
// listenForEvents don't hang around.
r.reset()
diff --git a/probe/endpoint/procspy/lsof.go b/probe/endpoint/procspy/lsof.go
index 0470f2ada..8a77a2323 100644
--- a/probe/endpoint/procspy/lsof.go
+++ b/probe/endpoint/procspy/lsof.go
@@ -15,7 +15,7 @@ var (
// parseLsof parses lsof out with `-F cn` argument.
//
// Format description: the first letter is the type of record, records are
-// newline seperated, the record starting with 'p' (pid) is a new processid.
+// newline separated, the record starting with 'p' (pid) is a new processid.
// There can be multiple connections for the same 'p' record in which case the
// 'p' is not repeated.
//
diff --git a/probe/endpoint/reporter_test.go b/probe/endpoint/reporter_test.go
index 09d8bdc3b..30e9ab897 100644
--- a/probe/endpoint/reporter_test.go
+++ b/probe/endpoint/reporter_test.go
@@ -65,7 +65,7 @@ var (
func TestSpyNoProcesses(t *testing.T) {
const (
nodeID = "heinz-tomato-ketchup" // TODO rename to hostID
- nodeName = "frenchs-since-1904" // TODO rename to hostNmae
+ nodeName = "frenchs-since-1904" // TODO rename to hostName
)
scanner := procspy.FixedScanner(fixConnections)
@@ -83,7 +83,7 @@ func TestSpyNoProcesses(t *testing.T) {
func TestSpyWithProcesses(t *testing.T) {
const (
nodeID = "nikon" // TODO rename to hostID
- nodeName = "fishermans-friend" // TODO rename to hostNmae
+ nodeName = "fishermans-friend" // TODO rename to hostName
)
scanner := procspy.FixedScanner(fixConnectionsWithProcesses)
diff --git a/probe/host/tagger.go b/probe/host/tagger.go
index 105104b82..de47bd3b3 100644
--- a/probe/host/tagger.go
+++ b/probe/host/tagger.go
@@ -29,7 +29,7 @@ func (t Tagger) Tag(r report.Report) (report.Report, error) {
parents = report.EmptySets.Add(report.Host, report.MakeStringSet(t.hostNodeID))
)
- // Explicity don't tag Endpoints and Addresses - These topologies include pseudo nodes,
+ // Explicitly don't tag Endpoints and Addresses - These topologies include pseudo nodes,
// and as such do their own host tagging
for _, topology := range []report.Topology{r.Process, r.Container, r.ContainerImage, r.Host, r.Overlay} {
for id, node := range topology.Nodes {
diff --git a/render/filters.go b/render/filters.go
index e75cc8be6..4aeb2bdc8 100644
--- a/render/filters.go
+++ b/render/filters.go
@@ -8,7 +8,7 @@ import (
"github.com/weaveworks/scope/report"
)
-// CustomRenderer allow for mapping functions that recived the entire topology
+// CustomRenderer allow for mapping functions that received the entire topology
// in one call - useful for functions that need to consider the entire graph.
// We should minimise the use of this renderer type, as it is very inflexible.
type CustomRenderer struct {
diff --git a/render/mapping.go b/render/mapping.go
index c0a2eb567..0cb97e51a 100644
--- a/render/mapping.go
+++ b/render/mapping.go
@@ -384,7 +384,7 @@ func MapEndpoint2Pseudo(n RenderableNode, local report.Networks) RenderableNodes
// It does not have enough info to do that, and the resulting graph
// must be merged with a process graph to get that info.
func MapEndpoint2Process(n RenderableNode, local report.Networks) RenderableNodes {
- // Nodes without a hostid are treated as psuedo nodes
+ // Nodes without a hostid are treated as pseudo nodes
if _, ok := n.Latest.Lookup(report.HostNodeID); !ok {
return MapEndpoint2Pseudo(n, local)
}
@@ -413,12 +413,12 @@ func MapEndpoint2Process(n RenderableNode, local report.Networks) RenderableNode
// It does not have enough info to do that, and the resulting graph
// must be merged with a container graph to get that info.
func MapProcess2Container(n RenderableNode, _ report.Networks) RenderableNodes {
- // Propogate the internet pseudo node
+ // Propagate the internet pseudo node
if strings.HasSuffix(n.ID, TheInternetID) {
return RenderableNodes{n.ID: n}
}
- // Don't propogate non-internet pseudo nodes
+ // Don't propagate non-internet pseudo nodes
if n.Pseudo {
return RenderableNodes{}
}
@@ -509,7 +509,7 @@ func MapCountProcessName(n RenderableNode, _ report.Networks) RenderableNodes {
// It does not have enough info to do that, and the resulting graph
// must be merged with a container graph to get that info.
func MapContainer2ContainerImage(n RenderableNode, _ report.Networks) RenderableNodes {
- // Propogate all pseudo nodes
+ // Propagate all pseudo nodes
if n.Pseudo {
return RenderableNodes{n.ID: n}
}
@@ -586,7 +586,7 @@ func MapContainerImage2Name(n RenderableNode, _ report.Networks) RenderableNodes
// It does not have enough info to do that, and the resulting graph
// must be merged with a container graph to get that info.
func MapX2Host(n RenderableNode, _ report.Networks) RenderableNodes {
- // Don't propogate all pseudo nodes - we do this in MapEndpoint2Host
+ // Don't propagate all pseudo nodes - we do this in MapEndpoint2Host
if n.Pseudo {
return RenderableNodes{}
}
@@ -604,7 +604,7 @@ func MapX2Host(n RenderableNode, _ report.Networks) RenderableNodes {
// MapEndpoint2Host takes nodes from the endpoint topology and produces
// host nodes or pseudo nodes.
func MapEndpoint2Host(n RenderableNode, local report.Networks) RenderableNodes {
- // Nodes without a hostid are treated as psuedo nodes
+ // Nodes without a hostid are treated as pseudo nodes
if _, ok := n.Latest.Lookup(report.HostNodeID); !ok {
return MapEndpoint2Pseudo(n, local)
}
@@ -628,7 +628,7 @@ func MapEndpoint2Host(n RenderableNode, local report.Networks) RenderableNodes {
// It does not have enough info to do that, and the resulting graph
// must be merged with a container graph to get that info.
func MapContainer2Pod(n RenderableNode, _ report.Networks) RenderableNodes {
- // Propogate all pseudo nodes
+ // Propagate all pseudo nodes
if n.Pseudo {
return RenderableNodes{n.ID: n}
}
@@ -673,7 +673,7 @@ func MapContainer2Pod(n RenderableNode, _ report.Networks) RenderableNodes {
// It does not have enough info to do that, and the resulting graph
// must be merged with a pod graph to get that info.
func MapPod2Service(pod RenderableNode, _ report.Networks) RenderableNodes {
- // Propogate all pseudo nodes
+ // Propagate all pseudo nodes
if pod.Pseudo {
return RenderableNodes{pod.ID: pod}
}
@@ -700,7 +700,7 @@ func MapPod2Service(pod RenderableNode, _ report.Networks) RenderableNodes {
// MapContainer2Hostname maps container RenderableNodes to 'hostname' renderabled nodes..
func MapContainer2Hostname(n RenderableNode, _ report.Networks) RenderableNodes {
- // Propogate all pseudo nodes
+ // Propagate all pseudo nodes
if n.Pseudo {
return RenderableNodes{n.ID: n}
}
diff --git a/report/id.go b/report/id.go
index 0aefcd5fd..2919f71d2 100644
--- a/report/id.go
+++ b/report/id.go
@@ -64,7 +64,7 @@ func MakeEndpointNodeID(hostID, address, port string) string {
func MakeAddressNodeID(hostID, address string) string {
var scope string
- // Loopback addresses and addresses explicity marked as
+ // Loopback addresses and addresses explicitly marked as
// local get scoped by hostID
addressIP := net.ParseIP(address)
if addressIP != nil && LocalNetworks.Contains(addressIP) {
diff --git a/report/report.go b/report/report.go
index bb298ec02..3878e530e 100644
--- a/report/report.go
+++ b/report/report.go
@@ -72,7 +72,7 @@ type Report struct {
// before serving it to consumers.
Window time.Duration
- // Shortcut reports should be propogated to the UI as quickly as possible,
+ // Shortcut reports should be propagated to the UI as quickly as possible,
// bypassing the usual spy interval, publish interval and app ws interval.
Shortcut bool
diff --git a/test/poll.go b/test/poll.go
index 4a120aa18..3bec35688 100644
--- a/test/poll.go
+++ b/test/poll.go
@@ -8,7 +8,7 @@ import (
"github.com/weaveworks/scope/test/reflect"
)
-// Poll repeatedly evaluates condition until we either timeout, or it suceeds.
+// Poll repeatedly evaluates condition until we either timeout, or it succeeds.
func Poll(t *testing.T, d time.Duration, want interface{}, have func() interface{}) {
deadline := time.Now().Add(d)
for {
diff --git a/tools/lint b/tools/lint
index 22db070c0..7d539f5da 100755
--- a/tools/lint
+++ b/tools/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
diff --git a/tools/rebuild-image b/tools/rebuild-image
index ea54f7403..1e00cbbe0 100755
--- a/tools/rebuild-image
+++ b/tools/rebuild-image
@@ -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
diff --git a/tools/socks/main.go b/tools/socks/main.go
index 6cde493d3..520df27d9 100644
--- a/tools/socks/main.go
+++ b/tools/socks/main.go
@@ -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) {