-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pre-commit hook, release gha, go fmt, vet
- Loading branch information
1 parent
88fb377
commit 7f04069
Showing
14 changed files
with
228 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
extends: | ||
- "@commitlint/config-conventional" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: codfish/semantic-release-action@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
hooks: | ||
- id: check-json | ||
- id: check-yaml | ||
args: [--allow-multiple-documents] | ||
- id: pretty-format-json | ||
args: | ||
- --autofix | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.3.0 | ||
hooks: | ||
- id: prettier | ||
stages: [commit] | ||
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook | ||
rev: v4.1.0 | ||
hooks: | ||
- id: commitlint | ||
stages: [commit-msg] | ||
additional_dependencies: ["@commitlint/config-conventional"] | ||
- repo: https://github.com/jumanjihouse/pre-commit-hooks | ||
rev: 2.1.6 | ||
hooks: | ||
- id: shellcheck | ||
args: ["--exclude=SC2086,SC2155"] | ||
- id: shfmt | ||
- id: script-must-have-extension | ||
- id: markdownlint # Configure in .mdlrc | ||
- repo: https://github.com/rhysd/actionlint | ||
rev: v1.6.8 | ||
hooks: | ||
- id: actionlint | ||
- repo: https://github.com/amazingandyyy/pre-commit-golang | ||
# fork dnephin/pre-commit-golang to fix go vet | ||
rev: v0.5.1 | ||
hooks: | ||
# lint -> fmt -> vet https://sparkbox.com/foundry/go_vet_gofmt_golint_to_code_check_in_Go | ||
- id: golangci-lint | ||
- id: go-fmt | ||
- id: go-vet | ||
- id: no-go-testing | ||
- id: go-build | ||
args: ["cmd/main.go"] | ||
stages: [commit] | ||
- id: go-mod-tidy | ||
# TODO: make go build | ||
# - id: go-build | ||
# stages: [commit] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"branches": [ | ||
"main", | ||
{ | ||
"channel": "next", | ||
"name": "(f|b|c)/*", | ||
"prerelease": "beta-<%= (/^\\w+-\\d+/.exec(name.substr(2)) || [])[0] %>" | ||
} | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
brew "pre-commit" | ||
tap "golangci/tap" | ||
brew "golangci/tap/golangci-lint" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"entries": { | ||
"brew": { | ||
"golangci/tap/golangci-lint": { | ||
"bottle": false, | ||
"version": "HEAD-f79bc88" | ||
}, | ||
"pre-commit": { | ||
"bottle": { | ||
"files": { | ||
"arm64_big_sur": { | ||
"cellar": ":any", | ||
"sha256": "681fbfef68e15d147cbb07300769b1fed16d7fca48b8511e10d3bfd199f9dc15", | ||
"url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:681fbfef68e15d147cbb07300769b1fed16d7fca48b8511e10d3bfd199f9dc15" | ||
}, | ||
"arm64_monterey": { | ||
"cellar": ":any", | ||
"sha256": "55643e1b35da1e839e6b04f3c56e7ba443ee2d552912c89dde93c62a979f0964", | ||
"url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:55643e1b35da1e839e6b04f3c56e7ba443ee2d552912c89dde93c62a979f0964" | ||
}, | ||
"big_sur": { | ||
"cellar": ":any", | ||
"sha256": "8682d70e01a2f4a111a78bd26be72002d463610db5bb192845405668b05086de", | ||
"url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:8682d70e01a2f4a111a78bd26be72002d463610db5bb192845405668b05086de" | ||
}, | ||
"catalina": { | ||
"cellar": ":any", | ||
"sha256": "6ab32f6e215e23ee10c76a35cee2b6ccb9cbc8d8179aaaaaa3cfe8a40fe83074", | ||
"url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:6ab32f6e215e23ee10c76a35cee2b6ccb9cbc8d8179aaaaaa3cfe8a40fe83074" | ||
}, | ||
"monterey": { | ||
"cellar": ":any", | ||
"sha256": "a029c996600ac11b3efda59cc5fac22ffe751e0cd9c286d34a61426a43f59761", | ||
"url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:a029c996600ac11b3efda59cc5fac22ffe751e0cd9c286d34a61426a43f59761" | ||
}, | ||
"x86_64_linux": { | ||
"cellar": ":any_skip_relocation", | ||
"sha256": "0cd0c648f0b0f2edc735616cfa967d0012f8410b97067925fc6303ca1c0f68ef", | ||
"url": "https://ghcr.io/v2/homebrew/core/pre-commit/blobs/sha256:0cd0c648f0b0f2edc735616cfa967d0012f8410b97067925fc6303ca1c0f68ef" | ||
} | ||
}, | ||
"rebuild": 0, | ||
"root_url": "https://ghcr.io/v2/homebrew/core" | ||
}, | ||
"version": "2.18.1" | ||
} | ||
}, | ||
"tap": { | ||
"golangci/tap": { | ||
"revision": "c54fadcaf92191be7fd388a714dccb1f24f73496" | ||
} | ||
} | ||
}, | ||
"system": { | ||
"macos": { | ||
"monterey": { | ||
"CLT": "13.3.1.0.1.1648687083", | ||
"HOMEBREW_PREFIX": "/opt/homebrew", | ||
"HOMEBREW_VERSION": "3.4.7", | ||
"Homebrew/homebrew-core": "9e6c2e2b31ec47136266ada0c32a2ecf0589c20e", | ||
"Xcode": "13.3", | ||
"macOS": "12.2.1" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.