further chore

This commit is contained in:
David Arnold 2020-06-04 14:30:56 -05:00
parent 9ed519ec69
commit c538bac938
No known key found for this signature in database
GPG Key ID: 6D6A936E69C59D08

View File

@ -1,19 +1,23 @@
# use with https://github.com/casey/just # use with https://github.com/casey/just
# fixe auto-fixable lint issues in all files # fixe auto-fixable lint issues in staged files
fix: fix:
~/bin/pre-commit run go-returns # fixes all Go lint issues ~/bin/pre-commit run go-returns # fixes all Go lint issues
~/bin/pre-commit run prettier # fixes all Markdown (& other) lint issues ~/bin/pre-commit run prettier # fixes all Markdown (& other) lint issues
# lint most common issues in all files # lint most common issues in - or due - to staged files
lint: lint:
~/bin/pre-commit run go-vet-mod || true # runs go vet ~/bin/pre-commit run go-vet-mod || true # runs go vet
~/bin/pre-commit run go-lint || true # runs golint ~/bin/pre-commit run go-lint || true # runs golint
~/bin/pre-commit run go-critic || true # runs gocritic ~/bin/pre-commit run go-critic || true # runs gocritic
# lint all issues in all files through meta linter # lint all issues in - or due - to staged files
lint-all: lint-all:
~/bin/pre-commit run golangci-lint-mod || true # runs golangci-lint on the module level ~/bin/pre-commit run golangci-lint-mod || true # runs golangci-lint
# run tests in - or due - to staged files
test:
~/bin/pre-commit run go-test-mod || true # runs go test
# commit skipping pre-commit hooks # commit skipping pre-commit hooks
commit m: commit m:
@ -23,9 +27,15 @@ commit m:
amend: amend:
git commit --amend --no-verify git commit --amend --no-verify
# install / update code automation tools (prettier, pre-commit, goreturns) # install/update code automation (prettier, pre-commit, goreturns, lintpack, gocritic, golangci-lint)
setup: install:
npm i -g prettier npm i -g prettier
curl https://pre-commit.com/install-local.py | python3 - curl https://pre-commit.com/install-local.py | python3 -
~/bin/pre-commit install --install-hooks
go get github.com/sqs/goreturns go get github.com/sqs/goreturns
go get github.com/go-lintpack/lintpack/...
go get github.com/go-critic/go-critic/...
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(shell go env GOPATH)/bin v1.27.0
# setup pre-commit hooks (optional)
setup:
~/bin/pre-commit install --install-hooks