Skip to content

Commit

Permalink
update go; update mage-extras; lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Pennebaker committed Aug 14, 2024
1 parent 42bd157 commit 5bd8741
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- uses: "actions/checkout@v4"
- run: "sudo apt-get update"
- run: "sudo apt-get install -y cargo make npm wget"
- run: "wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz"
- run: "sudo tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz"
- run: "wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz"
- run: "sudo tar -C /usr/local -xzf go1.23.0.linux-amd64.tar.gz"
- run: "make"
#
# Docker-in-Docker GitHub Actions setup required for docker scout SAC.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: "actions/checkout@v4"
- run: "sudo apt-get update"
- run: "sudo apt-get install -y cargo make npm wget"
- run: "wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz"
- run: "sudo tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz"
- run: "wget https://go.dev/dl/go1.23.0.linux-amd64.tar.gz"
- run: "sudo tar -C /usr/local -xzf go1.23.0.linux-amd64.tar.gz"
- run: "make"
- run: "mage lint"
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
golang 1.22.5
golang 1.23.0
nodejs 20.10.0
rust 1.75.0
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BUILDTIME REQUIREMENTS

* [Docker](https://www.docker.com/) 20.10.12+
* [Go](https://go.dev/) 1.22.5+
* [Go](https://go.dev/) 1.23.0+
* POSIX compatible [make](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html)
* [Node.js](https://nodejs.org/en) 20.10.0+
* [Rust](https://www.rust-lang.org/) 1.75.0+
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ BSD-2-Clause

# RUNTIME REQUIREMENTS

* [Docker](https://www.docker.com/) 20.10.12+
* [Docker](https://www.docker.com/) 27+

## Recommended

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/mcandre/tug

go 1.21
go 1.23

require (
github.com/magefile/mage v1.14.0
github.com/mcandre/mage-extras v0.0.17
github.com/mcandre/mage-extras v0.0.18
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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.17 h1:Ihe4gfRYpn1Goowzk339YmYC1K9jXN2aJ9GaMUtiGDU=
github.com/mcandre/mage-extras v0.0.17/go.mod h1:OvwmvvrYj+Eb+8LCL8ScRMJ9wr0KMbsbV1Ry68zH99k=
github.com/mcandre/mage-extras v0.0.18 h1:f7aZZGmqnElr3GcMZQvz//cn1uxneHEMrY5X7NysQIM=
github.com/mcandre/mage-extras v0.0.18/go.mod h1:zr+/cO9v8EtPmjHMVYx7ijYrbT3tfJSNgXc9ze6LJ4s=
12 changes: 10 additions & 2 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,27 @@ func Test() error {
return cmd.Run()
}

// GoVet runs go vet with shadow checks enabled.
func GoVet() error { return mageextras.GoVetShadow() }
// Deadcode runs deadcode.
func Deadcode() error { return mageextras.Deadcode("./...") }

// Gofmt runs gofmt.
func GoFmt() error { return mageextras.GoFmt("-s", "-w") }

// GoImports runs goimports.
func GoImports() error { return mageextras.GoImports("-w") }

// GoVet runs default go vet analyzers.
func GoVet() error { return mageextras.GoVet() }

// Errcheck runs errcheck.
func Errcheck() error { return mageextras.Errcheck("-blank") }

// Nakedret runs nakedret.
func Nakedret() error { return mageextras.Nakedret("-l", "0") }

// Shadow runs go vet with shadow checks enabled.
func Shadow() error { return mageextras.GoVetShadow() }

// Staticcheck runs staticcheck.
func Staticcheck() error { return mageextras.Staticcheck() }

Expand All @@ -74,11 +80,13 @@ func Unmake() error {

// Lint runs the lint suite.
func Lint() error {
mg.Deps(Deadcode)
mg.Deps(GoVet)
mg.Deps(GoFmt)
mg.Deps(GoImports)
mg.Deps(Errcheck)
mg.Deps(Nakedret)
mg.Deps(Shadow)
mg.Deps(Staticcheck)
mg.Deps(Unmake)
return nil
Expand Down
3 changes: 2 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ 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.6
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
go install golang.org/x/vuln/cmd/govulncheck@latest
go install honnef.co/go/tools/cmd/staticcheck@2023.1.3
go install honnef.co/go/tools/cmd/staticcheck@2024.1
go mod tidy

npm install -g snyk
2 changes: 1 addition & 1 deletion vendor/github.com/mcandre/mage-extras/.rubberstamp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/mcandre/mage-extras/.tool-versions

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/mcandre/mage-extras/DEVELOPMENT.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/github.com/mcandre/mage-extras/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions vendor/github.com/mcandre/mage-extras/deadcode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions vendor/github.com/mcandre/mage-extras/magefile.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/mcandre/mage-extras/makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -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.17
## explicit; go 1.21
# github.com/mcandre/mage-extras v0.0.18
## explicit; go 1.23
github.com/mcandre/mage-extras

0 comments on commit 5bd8741

Please sign in to comment.