Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

fix: use golangci-lint in favour of go-critic #550

Merged
merged 7 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .ci/scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ set -euxo pipefail
#

# Install some other dependencies required for the pre-commit
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.34.1

go get -v golang.org/x/lint/golint
go get -v github.com/go-lintpack/lintpack/...
go get -v github.com/go-critic/go-critic/...
lintpack build -o bin/gocritic -linter.version='v0.3.4' -linter.name='gocritic' github.com/go-critic/go-critic/checkers

# Install project dependencies
make -C cli install
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ repos:
hooks:
- id: go-fmt
- id: go-lint
- id: validate-toml
- id: go-vet
- id: no-go-testing
- id: go-critic
- id: golangci-lint

- repo: git@github.com:elastic/apm-pipeline-library
rev: current
Expand Down
4 changes: 0 additions & 4 deletions cli/internal/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,13 @@ func Update(id string, workdir string, composeFilePaths []string, env map[string
}
}

args := []string{}
for i, f := range composeFilePaths {
args = append(args, "-f", f)

if i > 0 {
run.Services = append(run.Services, stateService{
Name: filepath.Base(filepath.Dir(f)),
})
}
}
args = append(args, "config")

bytes, err := yaml.Marshal(&run)
if err != nil {
Expand Down
110 changes: 0 additions & 110 deletions e2e/runner_test.go

This file was deleted.

3 changes: 1 addition & 2 deletions e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import (
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

//nolint:unused
var seededRand *rand.Rand = rand.New(
rand.NewSource(time.Now().UnixNano()))
var seededRand = rand.New(rand.NewSource(time.Now().UnixNano()))

// GetExponentialBackOff returns a preconfigured exponential backoff instance
func GetExponentialBackOff(elapsedTime time.Duration) *backoff.ExponentialBackOff {
Expand Down