mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-11 23:50:04 +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
|
||||
RUN curl -fsSL -o /tmp/lint-install.sh https://raw.githubusercontent.com/golangci/golangci-lint/master/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
|
||||
|
||||
# download modules
|
||||
|
|
|
|||
4
Makefile
4
Makefile
|
|
@ -7,6 +7,10 @@ all: test lint build
|
|||
test:
|
||||
go test -v ./...
|
||||
|
||||
.PHONY: fix
|
||||
fix:
|
||||
golangci-lint run --fix
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
golangci-lint run
|
||||
|
|
|
|||
3
main.go
3
main.go
|
|
@ -6,9 +6,10 @@ import (
|
|||
"net/url"
|
||||
"os"
|
||||
|
||||
"github.com/amacneil/dbmate/pkg/dbmate"
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/urfave/cli"
|
||||
|
||||
"github.com/amacneil/dbmate/pkg/dbmate"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
|||
|
|
@ -279,7 +279,6 @@ func (db *DB) Migrate() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// automatically update schema file, silence errors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue