M .build.yml => .build.yml +14 -19
@@ 4,38 4,33 @@ packages:
sources:
- https://git.sr.ht/~chrisppy/go-barefeed
tasks:
+- build: |
+ export GOPATH=$HOME/go
+ export PATH=$PATH:$GOPATH/bin
+ cd go-barefeed
+ make
- format: |
+ export GOPATH=$HOME/go
+ export PATH=$PATH:$GOPATH/bin
cd go-barefeed
- go fmt -x ./...
- go vet ./...
+ make format
- lint: |
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
- go get -u golang.org/x/lint/golint
- go get -u honnef.co/go/tools/cmd/staticcheck
- go get -u gitlab.com/opennota/check/cmd/aligncheck
- go get -u gitlab.com/opennota/check/cmd/structcheck
- go get -u gitlab.com/opennota/check/cmd/varcheck
- go get -u github.com/kisielk/errcheck
cd go-barefeed
- golint -set_exit_status ./...
- staticcheck ./...
- aligncheck ./...
- structcheck ./...
- varcheck ./...
- errcheck ./...
+ make lint
- security: |
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
- go get -u github.com/securego/gosec/cmd/gosec
cd go-barefeed
- gosec -exclude=G107,G204 ./...
+ make security
- dependencies: |
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
- go get -u github.com/psampaz/go-mod-outdated
cd go-barefeed
- go list -u -m -json all | go-mod-outdated -direct -ci
+ make dependencies
- test: |
+ export GOPATH=$HOME/go
+ export PATH=$PATH:$GOPATH/bin
cd go-barefeed
- go test ./...
+ make test
A Makefile => Makefile +44 -0
@@ 0,0 1,44 @@
+.POSIX:
+.SUFFIXES:
+
+GO = go
+RM = rm
+GOFLAGS =
+
+gosrc = $(shell find . -name '*.go')
+gosrc += go.mod go.sum
+goflags = $(GOFLAGS)
+
+all: barefeed
+barefeed: $(gosrc)
+ $(GO) build $(goflags)
+clean:
+ $(GO) mod tidy
+format:
+ $(GO) fmt -x ./...
+ $(GO) vet ./...
+lint:
+ $(GO) get -u golang.org/x/lint/golint
+ $(GO) get -u honnef.co/go/tools/cmd/staticcheck
+ $(GO) get -u gitlab.com/opennota/check/cmd/aligncheck
+ $(GO) get -u gitlab.com/opennota/check/cmd/structcheck
+ $(GO) get -u gitlab.com/opennota/check/cmd/varcheck
+ $(GO) get -u github.com/kisielk/errcheck
+ golint -set_exit_status ./...
+ staticcheck ./...
+ aligncheck ./...
+ structcheck ./...
+ varcheck ./...
+ errcheck ./...
+security:
+ $(GO) get -u github.com/securego/gosec/cmd/gosec
+ gosec -exclude=G107,G204 ./...
+dependencies:
+ $(GO) get -u github.com/psampaz/go-mod-outdated
+ $(GO) list -u -m -json all | go-mod-outdated -direct -ci
+test:
+ $(GO) test ./...
+check: clean format lint security dependencies test
+ make clean
+
+
M go.mod => go.mod +3 -0
@@ 4,5 4,8 @@ go 1.15
require (
git.sr.ht/~sircmpwn/go-bare v0.0.0-20210227202403-5dae5c48f917
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/kr/pretty v0.1.0 // indirect
github.com/stretchr/testify v1.7.0
+ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)
M go.sum => go.sum +13 -5
@@ 1,15 1,23 @@
git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=
-git.sr.ht/~sircmpwn/go-bare v0.0.0-20201210182351-86af428a8287 h1:mfySyh3Gq6RTlvHFGhrWKtmvTKBFKQQDpRc2Em0cDow=
-git.sr.ht/~sircmpwn/go-bare v0.0.0-20201210182351-86af428a8287/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA=
-github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
+git.sr.ht/~sircmpwn/go-bare v0.0.0-20210227202403-5dae5c48f917 h1:/pfEvB399XDXksu4vyjfNTytWn/nbbKiNhvjtpgc4pY=
+git.sr.ht/~sircmpwn/go-bare v0.0.0-20210227202403-5dae5c48f917/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
+gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=