Skip to content

Commit

Permalink
improves memory usage of golangci-linter
Browse files Browse the repository at this point in the history
  • Loading branch information
cyriltovena authored and Ed committed May 7, 2019
1 parent b8b7caa commit fa4f936
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 0 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
36 changes: 0 additions & 36 deletions .gometalinter.json

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions loki-build-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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"
Expand All @@ -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"]
1 change: 1 addition & 0 deletions pkg/ingester/flush_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down

0 comments on commit fa4f936

Please sign in to comment.