Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deps #52

Merged
merged 1 commit into from
Mar 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/autorelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.18
-
name: Import GPG signing key
id: import_gpg
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
go run helpers/changelog/main.go >../RELEASE_NOTES
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.8.1
uses: goreleaser/goreleaser-action@v2.9.1
with:
version: latest
args: release --rm-dist --release-notes=../RELEASE_NOTES
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.x
go-version: 1.18

- name: Ubuntu Dependencies
run: sudo apt-get install --yes git gnupg2
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.x
go-version: 1.18

- name: MacOS Dependencies
run: brew install git gnupg
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: golangci-lint

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read
pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest # we have a list of linters in our .golangci.yml config file
only-new-issues: true
70 changes: 70 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
run:
skip-dirs:
- helpers/
go: 1.18

linters-settings:
gocyclo:
min-complexity: 22
cyclop:
max-complexity: 22
skip-tests: true
staticcheck:
go: "1.18"
# https://staticcheck.io/docs/options#checks
checks: ["all","-SA1019"]
funlen:
lines: -1
statements: 100

linters:
enable-all: true
disable:
- bodyclose
- contextcheck
- durationcheck
- dupl
- exhaustivestruct
- forbidigo
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godox
- goerr113
- golint
- gomnd
- gosec
- gosimple
- govet
- interfacer
- ireturn
- lll
- maintidx
- maligned
- nilerr
- noctx
- revive
- rowserrcheck
- scopelint
- sqlclosecheck
- staticcheck
- structcheck
- stylecheck
- tagliatelle
- testpackage
- tparallel
- typecheck
- unparam
- unused
- varnamelen
- wastedassign
- wrapcheck
- wsl

issues:
exclude-use-default: false # disable filtering of defaults for better zero-issue policy
max-per-linter: 0 # disable limit; report all issues of a linter
max-same-issues: 0 # disable limit; report all issues of the same issue
84 changes: 15 additions & 69 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,81 +99,27 @@ full:
codequality:
@echo ">> CODE QUALITY"

@echo -n " REVIVE "
@which revive > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/mgechev/revive; \
@echo -n " GOLANGCI-LINT "
@which golangci-lint > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; \
fi
@revive -formatter friendly -exclude vendor/... ./...
@printf '%s\n' '$(OK)'

@echo -n " FMT "
@$(foreach gofile, $(GOFILES_NOVENDOR),\
out=$$(gofmt -s -l -d -e $(gofile) | tee /dev/stderr); if [ -n "$$out" ]; then exit 1; fi;)
@printf '%s\n' '$(OK)'

@echo -n " CLANGFMT "
@$(foreach pbfile, $(PROTOFILES),\
if [ $$(clang-format -output-replacements-xml $(pbfile) | wc -l) -gt 3 ]; then exit 1; fi;)
@printf '%s\n' '$(OK)'

@echo -n " VET "
@$(GO) vet ./...
@printf '%s\n' '$(OK)'
@golangci-lint run --max-issues-per-linter 0 --max-same-issues 0 --sort-results || exit 1

@echo -n " CYCLO "
@which gocyclo > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/fzipp/gocyclo/cmd/gocyclo; \
fi
@$(foreach gofile, $(GOFILES_NOVENDOR),\
gocyclo -over 22 $(gofile) || exit 1;)
@printf '%s\n' '$(OK)'

@echo -n " LINT "
@which golint > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u golang.org/x/lint/golint; \
fi
@$(foreach pkg, $(PKGS),\
golint -set_exit_status $(pkg) || exit 1;)
@printf '%s\n' '$(OK)'

@echo -n " INEFF "
@which ineffassign > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/gordonklaus/ineffassign; \
fi
@ineffassign . || exit 1
@printf '%s\n' '$(OK)'

@echo -n " SPELL "
@which misspell > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/client9/misspell/cmd/misspell; \
fi
@$(foreach gofile, $(GOFILES_NOVENDOR),\
misspell --error $(gofile) || exit 1;)
@printf '%s\n' '$(OK)'

@echo -n " STATICCHECK "
@which staticcheck > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u honnef.co/go/tools/cmd/staticcheck; \
fi
@staticcheck $(PKGS) || exit 1
@printf '%s\n' '$(OK)'

@echo -n " UNPARAM "
@which unparam > /dev/null; if [ $$? -ne 0 ]; then \
$(GO) get -u mvdan.cc/unparam; \
fi
@unparam -exported=false $(PKGS)
@printf '%s\n' '$(OK)'

gen:
@go generate ./...
@$(GO) generate ./...

fmt:
@gofmt -s -l -w $(GOFILES_NOVENDOR)
@goimports -l -w $(GOFILES_NOVENDOR)
@which clang-format > /dev/null; if [ $$? -eq 0 ]; then \
clang-format -i $(PROTOFILES); \
fi
@go mod tidy
@gofumpt -s -l -w $(GOFILES_NOVENDOR)
@gci write $(GOFILES_NOVENDOR)
@$(GO) mod tidy

deps:
@$(GO) build -v ./...

upgrade: gen fmt
@$(GO) get -u ./...
@$(GO) mod tidy

.PHONY: clean build completion install sysinfo crosscompile test codequality
50 changes: 44 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,54 @@
module github.com/gopasspw/gopass-jsonapi

go 1.14
go 1.18

require (
github.com/blang/semver v3.5.1+incompatible
github.com/fatih/color v1.13.0
github.com/gopasspw/gopass v1.13.1
github.com/gopasspw/gopass v1.14.0
github.com/mitchellh/go-homedir v1.1.0
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.1
github.com/stretchr/testify v1.7.0
github.com/urfave/cli/v2 v2.4.0
golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2
golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c
golang.org/x/net v0.0.0-20220325170049-de3da57026de
golang.org/x/sys v0.0.0-20220325203850-36772127a21f
)

require (
bitbucket.org/creachadair/stringset v0.0.10 // indirect
filippo.io/age v1.0.0 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/caspr-io/yamlpath v0.0.0-20200722075116-502e8d113a9b // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/godbus/dbus v0.0.0-20190623212516-8a1682060722 // indirect
github.com/gokyle/twofactor v1.0.1 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/go-github v17.0.0+incompatible // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/muesli/crunchy v0.4.0 // indirect
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/zerolog v1.26.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/twpayne/go-pinentry v0.2.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 // indirect
golang.org/x/exp v0.0.0-20220325121720-054d8573a5d8 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
rsc.io/qr v0.2.0 // indirect
)
Loading