You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-25 22:41:46 +02:00
run golangci-lint in all directories with go.mod (#138)
* Run golangci-lint in all directories with go.mod * Imports fix by golangci-lint * Propagate failures from commands running in loops
This commit is contained in:
10
Makefile
10
Makefile
@@ -32,9 +32,13 @@ $(TOOLS_DIR)/stringer: go.mod go.sum tools.go
|
|||||||
|
|
||||||
precommit: $(TOOLS_DIR)/golangci-lint $(TOOLS_DIR)/misspell $(TOOLS_DIR)/stringer
|
precommit: $(TOOLS_DIR)/golangci-lint $(TOOLS_DIR)/misspell $(TOOLS_DIR)/stringer
|
||||||
PATH="$(abspath $(TOOLS_DIR)):$${PATH}" go generate ./...
|
PATH="$(abspath $(TOOLS_DIR)):$${PATH}" go generate ./...
|
||||||
$(TOOLS_DIR)/golangci-lint run --fix # TODO: Fix this on windows.
|
# TODO: Fix this on windows.
|
||||||
|
set -e; for dir in $(ALL_GO_MOD_DIRS); do \
|
||||||
|
echo "golangci-lint in $${dir}"; \
|
||||||
|
(cd "$${dir}" && $(abspath $(TOOLS_DIR))/golangci-lint run --fix); \
|
||||||
|
done
|
||||||
$(TOOLS_DIR)/misspell -w $(ALL_DOCS)
|
$(TOOLS_DIR)/misspell -w $(ALL_DOCS)
|
||||||
for dir in $(ALL_GO_MOD_DIRS); do \
|
set -e; for dir in $(ALL_GO_MOD_DIRS); do \
|
||||||
echo "go mod tidy in $${dir}"; \
|
echo "go mod tidy in $${dir}"; \
|
||||||
(cd "$${dir}" && go mod tidy); \
|
(cd "$${dir}" && go mod tidy); \
|
||||||
done
|
done
|
||||||
@@ -67,7 +71,7 @@ test-386:
|
|||||||
|
|
||||||
.PHONY: examples
|
.PHONY: examples
|
||||||
examples:
|
examples:
|
||||||
@for ex in $(EXAMPLES); do \
|
@set -e; for ex in $(EXAMPLES); do \
|
||||||
echo "Building $${ex}"; \
|
echo "Building $${ex}"; \
|
||||||
(cd "$${ex}" && go build .); \
|
(cd "$${ex}" && go build .); \
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go.opentelemetry.io/plugin/httptrace"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
@@ -26,6 +25,7 @@ import (
|
|||||||
"go.opentelemetry.io/api/key"
|
"go.opentelemetry.io/api/key"
|
||||||
"go.opentelemetry.io/api/tag"
|
"go.opentelemetry.io/api/tag"
|
||||||
"go.opentelemetry.io/api/trace"
|
"go.opentelemetry.io/api/trace"
|
||||||
|
"go.opentelemetry.io/plugin/httptrace"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
Reference in New Issue
Block a user