From 9cdb4d6b04c17fc8ce6b6b54476fcb4d4f7d089c Mon Sep 17 00:00:00 2001 From: Oliver Steele Date: Wed, 16 Jun 2021 15:48:07 +0800 Subject: [PATCH] Replace gometalinter -> golangci-lint --- CONTRIBUTING.md | 6 +++++- Makefile | 4 +--- cache/cache.go | 2 +- renderers/sass.go | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b17a1dd..dff6b1e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,8 @@ If you choose to contribute code, please review the [pull request template](http Fork and clone the repo. -[Install go](https://golang.org/doc/install#install). On macOS running Homebrew, `brew install go` is easier than the linked instructions. +[Install go](https://golang.org/doc/install#install). On macOS running Homebrew, +`brew install go` is easier than the linked instructions. Install package dependencies and development tools: @@ -24,6 +25,9 @@ make setup go get -t ./... ``` +[Install golangci-lint](https://golangci-lint.run/usage/install/#local-installation). +On macOS: `brew install golangci-lint` + ### Test and Lint ```bash diff --git a/Makefile b/Makefile index fa0ce0a..3f3b367 100644 --- a/Makefile +++ b/Makefile @@ -38,14 +38,12 @@ release: build setup: go mod init || true go get -t -u ./... - go get github.com/alecthomas/gometalinter - gometalinter --install install: go install ${LDFLAGS} ${PACKAGE} lint: - gometalinter ./... --tests --deadline=5m --disable=gotype --disable=aligncheck + golangci-lint run test: go test ./... diff --git a/cache/cache.go b/cache/cache.go index 6aa5236..0c567b2 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -46,7 +46,7 @@ func Disable() { // header and content are distinct parameters to relieve the caller from // having to concatenate them. func WithFile(header string, content string, fn func() (string, error)) (string, error) { - h := md5.New() // nolint: gas, noncrypto + h := md5.New() // nolint: gas io.WriteString(h, content) // nolint: errcheck, gas io.WriteString(h, "\n") // nolint: errcheck, gas io.WriteString(h, header) // nolint: errcheck, gas diff --git a/renderers/sass.go b/renderers/sass.go index 3c9cb83..98f1a30 100644 --- a/renderers/sass.go +++ b/renderers/sass.go @@ -30,7 +30,7 @@ func (p *Manager) copySASSFileIncludes() error { if err := p.makeSASSTempDir(); err != nil { return err } - h := md5.New() // nolint: gas, noncrypto + h := md5.New() // nolint: gas if p.ThemeDir != "" { if err := p.copySASSFiles(filepath.Join(p.ThemeDir, sassDirName), p.sassTempDir, h); err != nil { return err