mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2026-02-02 17:35:08 +01:00
Stricter linting (#113)
This commit is contained in:
parent
810bddaea8
commit
98066fadaa
5 changed files with 33 additions and 3 deletions
26
.golangci.yml
Normal file
26
.golangci.yml
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
- bodyclose
|
||||||
|
- deadcode
|
||||||
|
- depguard
|
||||||
|
- errcheck
|
||||||
|
- goimports
|
||||||
|
- gosimple
|
||||||
|
- govet
|
||||||
|
- ineffassign
|
||||||
|
- misspell
|
||||||
|
- nakedret
|
||||||
|
- staticcheck
|
||||||
|
- structcheck
|
||||||
|
- typecheck
|
||||||
|
- unconvert
|
||||||
|
- unparam
|
||||||
|
- unused
|
||||||
|
- varcheck
|
||||||
|
- whitespace
|
||||||
|
|
||||||
|
linters-settings:
|
||||||
|
goimports:
|
||||||
|
local-prefixes: github.com/amacneil/dbmate
|
||||||
|
misspell:
|
||||||
|
locale: US
|
||||||
|
|
@ -19,7 +19,7 @@ RUN apt-get update \
|
||||||
# golangci-lint
|
# golangci-lint
|
||||||
RUN curl -fsSL -o /tmp/lint-install.sh https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
|
RUN curl -fsSL -o /tmp/lint-install.sh https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
|
||||||
&& chmod +x /tmp/lint-install.sh \
|
&& chmod +x /tmp/lint-install.sh \
|
||||||
&& /tmp/lint-install.sh -b /usr/local/bin v1.18.0 \
|
&& /tmp/lint-install.sh -b /usr/local/bin v1.22.2 \
|
||||||
&& rm -f /tmp/lint-install.sh
|
&& rm -f /tmp/lint-install.sh
|
||||||
|
|
||||||
# download modules
|
# download modules
|
||||||
|
|
|
||||||
4
Makefile
4
Makefile
|
|
@ -7,6 +7,10 @@ all: test lint build
|
||||||
test:
|
test:
|
||||||
go test -v ./...
|
go test -v ./...
|
||||||
|
|
||||||
|
.PHONY: fix
|
||||||
|
fix:
|
||||||
|
golangci-lint run --fix
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint:
|
lint:
|
||||||
golangci-lint run
|
golangci-lint run
|
||||||
|
|
|
||||||
3
main.go
3
main.go
|
|
@ -6,9 +6,10 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/amacneil/dbmate/pkg/dbmate"
|
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
|
|
||||||
|
"github.com/amacneil/dbmate/pkg/dbmate"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,6 @@ func (db *DB) Migrate() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// automatically update schema file, silence errors
|
// automatically update schema file, silence errors
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue