-
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.
- Loading branch information
1 parent
6d25dc1
commit ff9bac5
Showing
5 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,32 @@ | ||
name: linting | ||
|
||
on: ["push", "pull_request"] | ||
|
||
jobs: | ||
ci: | ||
name: "run linting" | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
go: ["1.23.x"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: "checkout" | ||
uses: actions/checkout@v2 | ||
- name: "fetch unshallow" | ||
run: git fetch --prune --unshallow | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: "fmt" | ||
run: if [ "$(go fmt ./... | wc -l)" -gt 0 ]; then echo "go fmt failed, please run again locally"; exit 1; fi | ||
if: matrix.os == 'ubuntu-latest' | ||
- name: "imports" | ||
run: if [ "$(goimports -l . | wc -l)" -gt 0 ]; then echo "goimports failed, please run again locally"; exit 1; fi | ||
- name: "vet" | ||
run: "go vet ./..." | ||
- run: "go install honnef.co/go/tools/cmd/staticcheck@latest" | ||
- name: staticcheck | ||
run: "staticcheck ./..." |
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,24 @@ | ||
name: linting | ||
|
||
on: ["push", "pull_request"] | ||
|
||
jobs: | ||
ci: | ||
name: "run linting" | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest", "macOS-latest"] | ||
go: ["1.22.x", "1.23.x"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: "checkout" | ||
uses: actions/checkout@v2 | ||
- name: "fetch unshallow" | ||
run: git fetch --prune --unshallow | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: "test" | ||
run: "go test ./..." |
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,19 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: check-json | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: check-case-conflict | ||
- repo: https://github.com/igorshubovych/markdownlint-cli | ||
rev: v0.42.0 | ||
hooks: | ||
- id: markdownlint | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.3.0 | ||
hooks: | ||
- id: codespell | ||
args: [-I, .codespellignore] |
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,17 @@ | ||
# CLI helpers. | ||
|
||
# help | ||
help: | ||
@echo "Command line helpers for this project.\n" | ||
@just -l | ||
|
||
# Run go linting | ||
linting: | ||
goimports -w . | ||
go fmt . | ||
- go vet . | ||
- staticcheck . | ||
|
||
# Run pre-commit | ||
all-checks: | ||
pre-commit run --all-files |