Skip to content
Snippets Groups Projects
Commit fa4f936f authored by Cyril Tovena's avatar Cyril Tovena Committed by Ed
Browse files

improves memory usage of golangci-linter

parent b8b7caa4
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ workflows:
# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
defaults: &defaults
docker:
- image: grafana/loki-build-image:0.2.0
- image: grafana/loki-build-image:0.2.1
working_directory: /go/src/github.com/grafana/loki
jobs:
......
......@@ -24,15 +24,11 @@ run:
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
- ".*\\.y$"
- ".*yaccpar$"
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
......@@ -64,11 +60,7 @@ linters:
- unused # new from here.
- interfacer
- typecheck
- dupl
- gocyclo
- nakedret
issues:
exclude-use-default: false
exclude:
- Error return value of .*log\.Logger\)\.Log\x60 is not checked
\ No newline at end of file
{
"Vendor": true,
"Deadline": "5m",
"Concurrency": 2,
"Linters": {
"gofmt": {"Command": "gofmt -l -s -w"},
"goimports": {"Command": "goimports -l -w"}
},
"Exclude": [
"\\.pb\\.go",
"pkg/promtail/server/ui/assets_vfsdata.go",
"method Seek.*should have signature",
"error return value not checked \\(level\\.",
"\"err\" shadows declaration"
],
"Enable": [
"deadcode",
"errcheck",
"goconst",
"gofmt",
"goimports",
"golint",
"gosimple",
"gotypex",
"ineffassign",
"megacheck",
"misspell",
"structcheck",
"unconvert",
"unparam",
"varcheck",
"vet",
"vetshadow"
]
}
......@@ -172,7 +172,7 @@ $(EXES): loki-build-image/$(UPTODATE)
goyacc -p $(basename $(notdir $<)) -o $@ $<
lint: loki-build-image/$(UPTODATE)
golangci-lint run
GOGC=20 golangci-lint run
check-generated-files: loki-build-image/$(UPTODATE) yacc protos
@git diff-files || (echo "changed files; failing check" && exit 1)
......
FROM golang:1.11.2-stretch
FROM golang:1.11.4-stretch
RUN apt-get update && apt-get install -y file jq unzip protobuf-compiler libprotobuf-dev && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV DOCKER_VER="17.03.0-ce"
......@@ -18,9 +18,11 @@ RUN go get \
github.com/go-delve/delve/cmd/dlv \
golang.org/x/tools/cmd/goyacc && \
rm -rf /go/pkg /go/src
ENV GOLANGCI_LINT_VER="1.16.0"
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v${GOLANGCI_LINT_VER} && \
golangci-lint --version
ENV GOLANGCI_LINT_COMMIT="692dacb773b703162c091c2d8c59f9cd2d6801db"
RUN mkdir -p $(go env GOPATH)/src/github.com/golangci/ && git clone https://github.com/golangci/golangci-lint.git $(go env GOPATH)/src/github.com/golangci/golangci-lint && \
cd $(go env GOPATH)/src/github.com/golangci/golangci-lint && git checkout ${GOLANGCI_LINT_COMMIT} && cd cmd/golangci-lint/ &&\
GO111MODULE=on go install && \
golangci-lint help
COPY build.sh /
ENV GOCACHE=/go/cache
ENTRYPOINT ["/build.sh"]
......@@ -68,6 +68,7 @@ func newTestStore(t require.TestingT, cfg Config) (*testStore, *Ingester) {
return store, ing
}
// nolint
func defaultIngesterTestConfig() Config {
consul := ring.NewInMemoryKVClient()
cfg := Config{}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment