diff --git a/go.mod b/go.mod index 0cf0598..ac7396d 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.18 + github.com/mcandre/mage-extras v0.0.19 ) diff --git a/go.sum b/go.sum index 0946a06..5e52ecd 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.18 h1:f7aZZGmqnElr3GcMZQvz//cn1uxneHEMrY5X7NysQIM= -github.com/mcandre/mage-extras v0.0.18/go.mod h1:zr+/cO9v8EtPmjHMVYx7ijYrbT3tfJSNgXc9ze6LJ4s= +github.com/mcandre/mage-extras v0.0.19 h1:6xBSJ5eSmpgOdNoFe0X6JAhmeilCujVLJzOpCZ5vZqE= +github.com/mcandre/mage-extras v0.0.19/go.mod h1:zr+/cO9v8EtPmjHMVYx7ijYrbT3tfJSNgXc9ze6LJ4s= diff --git a/magefile.go b/magefile.go index 3752627..1eef282 100644 --- a/magefile.go +++ b/magefile.go @@ -52,6 +52,9 @@ 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() } @@ -84,6 +87,7 @@ func Lint() error { mg.Deps(GoVet) mg.Deps(GoFmt) mg.Deps(GoImports) + mg.Deps(GoLint) mg.Deps(Errcheck) mg.Deps(Nakedret) mg.Deps(Shadow) diff --git a/makefile b/makefile index 929a32e..e96eb27 100644 --- a/makefile +++ b/makefile @@ -8,7 +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/mcandre/factorio/cmd/factorio@v0.0.6 + go install github.com/mcandre/factorio/cmd/factorio@v0.0.8 + go install golang.org/x/lint/golint@latest 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/vendor/github.com/mcandre/mage-extras/.editorconfig b/vendor/github.com/mcandre/mage-extras/.editorconfig new file mode 100644 index 0000000..8a8f2ef --- /dev/null +++ b/vendor/github.com/mcandre/mage-extras/.editorconfig @@ -0,0 +1,63 @@ +# Most text files +[*] +charset = utf-8 +max_line_length = none +trim_trailing_whitespace = true +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 # bash8 + +# Machine-generated files +[*.{scpt,plist,dot,db}] +trim_trailing_whitespace = false +insert_final_newline = none +indent_size = none + +# Freeform text +[*.{txt,md,cob,emacs,el,lisp,lsp,scm,setup,meta,clj,rkt,ecl,sbcl,abcl,eclrc,sbclrc,asd,snusp}] +indent_size = none + +# Fix cmake +[CMakeLists.txt] +indent_size = 4 # bash8 + +# Align keys +[*.{yaml,yml,reek,.yamllint}] +indent_size = 2 + +# Placeholder files +[*.{gitkeep,__init__.py}] +insert_final_newline = none + +# +# Windows junk +# +[*.{cmd,bat,reg,ps1,vbs,cs,fs,fsx,ahk,psenvrc}] +end_of_line = crlf +insert_final_newline = false +[settings.json] +end_of_line = crlf +insert_final_newline = false + +# Lexer restrictions +[{makefile,Makefile,GNUmakefile,BSDmakefile}] +indent_style = tab +[*.{makefile,Makefile,mk,GNUmakefile,BSDmakefile,go,gitmodules}] +indent_style = tab + +# Natural HTML nesting +[*.js] +quote_type = single + +# Compressed artifacts +[*.min.*] +insert_final_newline = false +[*-min.*] +insert_final_newline = false + +# Potential mixed indentations +[*.patch] +trim_trailing_whitespace = false +indent_style = none +indent_size = none diff --git a/vendor/github.com/mcandre/mage-extras/.rubberstamp b/vendor/github.com/mcandre/mage-extras/.rubberstamp index 6775f73..2ccf2e2 100644 --- a/vendor/github.com/mcandre/mage-extras/.rubberstamp +++ b/vendor/github.com/mcandre/mage-extras/.rubberstamp @@ -1 +1 @@ -Thu Aug 1 00:05:52 UTC 2024 +Tue Oct 1 00:06:23 UTC 2024 diff --git a/vendor/github.com/mcandre/mage-extras/.tool-versions b/vendor/github.com/mcandre/mage-extras/.tool-versions index de2f08a..766e4b5 100644 --- a/vendor/github.com/mcandre/mage-extras/.tool-versions +++ b/vendor/github.com/mcandre/mage-extras/.tool-versions @@ -1,3 +1,2 @@ -golang 1.23.0 -nodejs 20.10.0 +golang 1.23.2 rust 1.75.0 diff --git a/vendor/github.com/mcandre/mage-extras/DEVELOPMENT.md b/vendor/github.com/mcandre/mage-extras/DEVELOPMENT.md index df2c6d8..e39d2ae 100644 --- a/vendor/github.com/mcandre/mage-extras/DEVELOPMENT.md +++ b/vendor/github.com/mcandre/mage-extras/DEVELOPMENT.md @@ -1,9 +1,9 @@ # BUILDTIME REQUIREMENTS -* [Go](https://go.dev/) 1.23.0+ +* [Go](https://go.dev/) 1.23.2+ * 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+ +* [Snyk](https://snyk.io/) * Provision additional dev tools with `make` ## Recommended @@ -12,6 +12,12 @@ * [direnv](https://direnv.net/) 2 * macOS [open](https://ss64.com/mac/open.html) or equivalent alias +Non-UNIX environments may produce subtle adverse effects when linting or generating application ports. + +## Windows + +Apply a user environment variable `GODEBUG=modcacheunzipinplace=1` per [access denied resolution](https://github.com/golang/go/wiki/Modules/e93463d3e853031af84204dc5d3e2a9a710a7607#go-115), for native Windows development environments (Command Prompt / PowerShell, not WLS, not Cygwin, not MSYS2, not MinGW, not msysGit, not Git Bash, not etc). + # AUDIT ```console diff --git a/vendor/github.com/mcandre/mage-extras/README.md b/vendor/github.com/mcandre/mage-extras/README.md index a8719ec..ff3e43a 100644 --- a/vendor/github.com/mcandre/mage-extras/README.md +++ b/vendor/github.com/mcandre/mage-extras/README.md @@ -53,7 +53,7 @@ BSD-2-Clause # RUNTIME REQUIREMENTS -* [Go](https://go.dev/) 1.23.0+ +* [Go](https://go.dev/) 1.23.2+ * [Mage](https://magefile.org/) (e.g., `go install github.com/magefile/mage`) ## Recommended diff --git a/vendor/github.com/mcandre/mage-extras/golint.go b/vendor/github.com/mcandre/mage-extras/golint.go new file mode 100644 index 0000000..6fd7bd5 --- /dev/null +++ b/vendor/github.com/mcandre/mage-extras/golint.go @@ -0,0 +1,32 @@ +package mageextras + +import ( + "os" + "os/exec" + + "github.com/magefile/mage/mg" +) + +// GoLint runs golint. +func GoLint(args ...string) error { + mg.Deps(CollectGoFiles) + + cmdName := "golint" + + for pth := range CollectedGoFiles { + cmdParameters := []string{cmdName} + cmdParameters = append(cmdParameters, args...) + cmdParameters = append(cmdParameters, pth) + + cmd := exec.Command(cmdName) + cmd.Args = cmdParameters + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + + if err := cmd.Run(); err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/mcandre/mage-extras/magefile.go b/vendor/github.com/mcandre/mage-extras/magefile.go index 0492350..de94704 100644 --- a/vendor/github.com/mcandre/mage-extras/magefile.go +++ b/vendor/github.com/mcandre/mage-extras/magefile.go @@ -48,6 +48,9 @@ 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() } @@ -78,6 +81,7 @@ func Unmake() error { func Lint() error { mg.Deps(GoFmt) mg.Deps(GoImports) + mg.Deps(GoLint) mg.Deps(GoVet) mg.Deps(Errcheck) mg.Deps(Nakedret) diff --git a/vendor/github.com/mcandre/mage-extras/makefile b/vendor/github.com/mcandre/mage-extras/makefile index 436b3ef..e3d9dd2 100644 --- a/vendor/github.com/mcandre/mage-extras/makefile +++ b/vendor/github.com/mcandre/mage-extras/makefile @@ -9,9 +9,8 @@ all: go install github.com/kisielk/errcheck@v1.7.0 go install github.com/magefile/mage@v1.14.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 go mod tidy - - npm install -g snyk diff --git a/vendor/github.com/mcandre/mage-extras/version.go b/vendor/github.com/mcandre/mage-extras/version.go index f9f0ca7..25bc2eb 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.16" +var Version = "0.0.19" diff --git a/vendor/modules.txt b/vendor/modules.txt index 0e7fbf4..5a47e16 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.18 +# github.com/mcandre/mage-extras v0.0.19 ## explicit; go 1.23 github.com/mcandre/mage-extras