diff --git a/cmd/tug/main.go b/cmd/tug/main.go index 0b4e8e1..880ff76 100644 --- a/cmd/tug/main.go +++ b/cmd/tug/main.go @@ -1,3 +1,4 @@ +// Package main implements a CLI application to automate common docker buildx workflows. package main import ( diff --git a/go.mod b/go.mod index ac7396d..ef99f39 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.23 require ( github.com/magefile/mage v1.14.0 - github.com/mcandre/mage-extras v0.0.19 + github.com/mcandre/mage-extras v0.0.20 ) diff --git a/go.sum b/go.sum index 5e52ecd..0c7019f 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ github.com/magefile/mage v1.14.0 h1:6QDX3g6z1YvJ4olPhT1wksUcSa/V0a1B+pJb73fBjyo= github.com/magefile/mage v1.14.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= -github.com/mcandre/mage-extras v0.0.19 h1:6xBSJ5eSmpgOdNoFe0X6JAhmeilCujVLJzOpCZ5vZqE= -github.com/mcandre/mage-extras v0.0.19/go.mod h1:zr+/cO9v8EtPmjHMVYx7ijYrbT3tfJSNgXc9ze6LJ4s= +github.com/mcandre/mage-extras v0.0.20 h1:hUw33CYkuyByVQW7eNv9E0gjTk2SMZ5Y8AWHdD4aVHM= +github.com/mcandre/mage-extras v0.0.20/go.mod h1:zr+/cO9v8EtPmjHMVYx7ijYrbT3tfJSNgXc9ze6LJ4s= diff --git a/magefile.go b/magefile.go index 1eef282..7577a95 100644 --- a/magefile.go +++ b/magefile.go @@ -52,9 +52,6 @@ func GoFmt() error { return mageextras.GoFmt("-s", "-w") } // GoImports runs goimports. func GoImports() error { return mageextras.GoImports("-w") } -// GoLint runs golint. -func GoLint() error { return mageextras.GoLint() } - // GoVet runs default go vet analyzers. func GoVet() error { return mageextras.GoVet() } @@ -64,6 +61,9 @@ func Errcheck() error { return mageextras.Errcheck("-blank") } // Nakedret runs nakedret. func Nakedret() error { return mageextras.Nakedret("-l", "0") } +// Revive runs revive. +func Revive() error { return mageextras.Revive() } + // Shadow runs go vet with shadow checks enabled. func Shadow() error { return mageextras.GoVetShadow() } @@ -87,9 +87,9 @@ func Lint() error { mg.Deps(GoVet) mg.Deps(GoFmt) mg.Deps(GoImports) - mg.Deps(GoLint) mg.Deps(Errcheck) mg.Deps(Nakedret) + mg.Deps(Revive) mg.Deps(Shadow) mg.Deps(Staticcheck) mg.Deps(Unmake) diff --git a/makefile b/makefile index e96eb27..6f52a69 100644 --- a/makefile +++ b/makefile @@ -9,7 +9,7 @@ all: go install github.com/kisielk/errcheck@v1.7.0 go install github.com/magefile/mage@v1.14.0 go install github.com/mcandre/factorio/cmd/factorio@v0.0.8 - go install golang.org/x/lint/golint@latest + go install github.com/mgechev/revive@v1.4.0 go install golang.org/x/tools/cmd/deadcode@latest go install golang.org/x/tools/cmd/goimports@latest go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest diff --git a/tug.go b/tug.go new file mode 100644 index 0000000..15394b2 --- /dev/null +++ b/tug.go @@ -0,0 +1,2 @@ +// Package tug implements primitives to organize docker buildx operations. +package tug diff --git a/vendor/github.com/mcandre/mage-extras/mageextras.go b/vendor/github.com/mcandre/mage-extras/mageextras.go new file mode 100644 index 0000000..88f78e6 --- /dev/null +++ b/vendor/github.com/mcandre/mage-extras/mageextras.go @@ -0,0 +1,2 @@ +// Package mageextras provides premade tasks for common mage workflows. +package mageextras diff --git a/vendor/github.com/mcandre/mage-extras/magefile.go b/vendor/github.com/mcandre/mage-extras/magefile.go index de94704..f7a3c16 100644 --- a/vendor/github.com/mcandre/mage-extras/magefile.go +++ b/vendor/github.com/mcandre/mage-extras/magefile.go @@ -48,9 +48,6 @@ func GoFmt() error { return mageextras.GoFmt("-s", "-w") } // GoImports runs goimports. func GoImports() error { return mageextras.GoImports("-w") } -// GoLint runs golint. -func GoLint() error { return mageextras.GoLint() } - // GoVet runs default go vet analyzers. func GoVet() error { return mageextras.GoVet() } @@ -60,6 +57,9 @@ func Errcheck() error { return mageextras.Errcheck("-blank") } // Nakedret runs nakedret. func Nakedret() error { return mageextras.Nakedret("-l", "0") } +// Revive runs revive. +func Revive() error { return mageextras.Revive() } + // Shadow runs go vet with shadow checks enabled. func Shadow() error { return mageextras.GoVetShadow() } @@ -81,10 +81,10 @@ func Unmake() error { func Lint() error { mg.Deps(GoFmt) mg.Deps(GoImports) - mg.Deps(GoLint) mg.Deps(GoVet) mg.Deps(Errcheck) mg.Deps(Nakedret) + mg.Deps(Revive) mg.Deps(Shadow) mg.Deps(Staticcheck) mg.Deps(Unmake) diff --git a/vendor/github.com/mcandre/mage-extras/makefile b/vendor/github.com/mcandre/mage-extras/makefile index e3d9dd2..906df2b 100644 --- a/vendor/github.com/mcandre/mage-extras/makefile +++ b/vendor/github.com/mcandre/mage-extras/makefile @@ -8,8 +8,8 @@ all: go install github.com/alexkohler/nakedret@v1.0.1 go install github.com/kisielk/errcheck@v1.7.0 go install github.com/magefile/mage@v1.14.0 + go install github.com/mgechev/revive@v1.4.0 go install golang.org/x/tools/cmd/goimports@latest - go install golang.org/x/lint/golint@latest go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest go install golang.org/x/vuln/cmd/govulncheck@latest go install honnef.co/go/tools/cmd/staticcheck@2024.1 diff --git a/vendor/github.com/mcandre/mage-extras/revive.go b/vendor/github.com/mcandre/mage-extras/revive.go new file mode 100644 index 0000000..aa153b9 --- /dev/null +++ b/vendor/github.com/mcandre/mage-extras/revive.go @@ -0,0 +1,17 @@ +package mageextras + +import ( + "os" + "os/exec" +) + +// Revive runs revive. +func Revive(args ...string) error { + cmd := exec.Command("revive") + cmd.Args = append(cmd.Args, "-exclude", "vendor/...") + cmd.Args = append(cmd.Args, args...) + cmd.Args = append(cmd.Args, "./...") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + return cmd.Run() +} diff --git a/vendor/github.com/mcandre/mage-extras/version.go b/vendor/github.com/mcandre/mage-extras/version.go index 25bc2eb..03e434b 100644 --- a/vendor/github.com/mcandre/mage-extras/version.go +++ b/vendor/github.com/mcandre/mage-extras/version.go @@ -1,4 +1,4 @@ package mageextras // Version is semver. -var Version = "0.0.19" +var Version = "0.0.20" diff --git a/vendor/github.com/mcandre/mage-extras/vet.go b/vendor/github.com/mcandre/mage-extras/vet.go index 5f18aaf..f20e61a 100644 --- a/vendor/github.com/mcandre/mage-extras/vet.go +++ b/vendor/github.com/mcandre/mage-extras/vet.go @@ -10,7 +10,7 @@ import ( // with variable shadow checking enabled. // // Depends on golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow -func GoVetShadow(args ...string) error { +func GoVetShadow() error { shadowPath, err := exec.LookPath("shadow") if err != nil { diff --git a/vendor/modules.txt b/vendor/modules.txt index 5a47e16..2afb724 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,6 +1,6 @@ # github.com/magefile/mage v1.14.0 ## explicit; go 1.12 github.com/magefile/mage/mg -# github.com/mcandre/mage-extras v0.0.19 +# github.com/mcandre/mage-extras v0.0.20 ## explicit; go 1.23 github.com/mcandre/mage-extras