~chrisppy/go-opml

53bc4ed5ee39e56975c41a21bcb40154ec944631 — Chris Palmer a month ago b3fd6a5 main
Add Makefile
4 files changed, 77 insertions(+), 28 deletions(-)

M .build.yml
A Makefile
M go.mod
M go.sum
M .build.yml => .build.yml +14 -19
@@ 4,38 4,33 @@ packages:
sources:
- https://git.sr.ht/~chrisppy/go-opml
tasks:
- build: |
    export GOPATH=$HOME/go
    export PATH=$PATH:$GOPATH/bin
    cd go-opml
    make
- format: |
    export GOPATH=$HOME/go
    export PATH=$PATH:$GOPATH/bin
    cd go-opml
    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-opml
    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-opml
    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-opml
    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-opml
    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: opml
opml: $(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 +5 -2
@@ 3,6 3,9 @@ module git.sr.ht/~chrisppy/go-opml
go 1.15

require (
	github.com/stretchr/testify v1.6.1
	golang.org/x/net v0.0.0-20201224014010-6772e930b67b
	github.com/davecgh/go-spew v1.1.1 // indirect
	github.com/kr/pretty v0.1.0 // indirect
	github.com/stretchr/testify v1.7.0
	golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4
	gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)

M go.sum => go.sum +14 -7
@@ 1,19 1,26 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
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.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4 h1:b0LrWgu8+q7z4J+0Y3Umo5q1dL7NXBkKBWkaVkAq17E=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e h1:FDhOuMEY4JVRztM/gsbk+IKUQ8kj74bxZrgw87eMMVc=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
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=