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

Commit

Permalink
fix: use golangci-lint in favour of go-critic (#550)
Browse files Browse the repository at this point in the history
* fix: remove var type as per golint's suggestion

* chore: add golangci-lint precommit hook

* chore: remove go-critic in fafvour of golangci-lint

* chore: remove TOML hook

* chore: add go-vet hook

* fix: remove unused variable

Detected by golangci-lint

* fix: remove unused Go file, which caused lint errors
  • Loading branch information
mdelapenya authored Jan 4, 2021
1 parent c655ae1 commit 600c6ac
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 121 deletions.
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

0 comments on commit 600c6ac

Please sign in to comment.