From 384f8008b91e73faae9dc6a67bdf3a6a2b26c639 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Wed, 27 Mar 2024 22:59:32 +0100 Subject: [PATCH] docs: update & document dev commands --- .github/workflows/go.yml | 2 +- .pre-commit-config.yaml | 7 +++++++ Makefile | 6 +++++- README.md | 18 ++++++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 14a7d6a..9b02a9c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -27,4 +27,4 @@ jobs: - name: Build run: go build -v ./... - name: Test - run: go test -v ./... -race + run: make test diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 417d900..4135fb7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,3 +12,10 @@ repos: rev: v1.57.1 hooks: - id: golangci-lint-full + - repo: local + hooks: + - id: go-test + name: go test ./... + language: golang + types_or: [go] + entry: make test diff --git a/Makefile b/Makefile index 0614a2d..efe0bd3 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ .PHONY: lint lint: - pre-commit run --all-files golangci-lint-full + pre-commit run --all-files + +.PHONY: test +test: + go test -race -v ./... diff --git a/README.md b/README.md index 4fd1d81..cbeb082 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,21 @@ func notOk() { } } ``` + +## Development + +Setup pre-commit locally: +```bash +pre-commit install +``` + +Run tests & linter: +```bash +make lint test +``` + +To release, just publish a git tag: +```bash +git tag -a v0.1.0 -m "v0.1.0" +git push --follow-tags +```