-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some precommit checks which cover things integration is doing (#138)
* Cleanup a bunch of lints found. Mostly not checking return values. * Add vscode settings for the things we require (coverage and the lint tool). Easier for adopters to avoid local setup
- Loading branch information
1 parent
aeb4cdd
commit 283fed7
Showing
18 changed files
with
193 additions
and
99 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 |
---|---|---|
|
@@ -3,14 +3,27 @@ name: PR | |
on: | ||
- pull_request | ||
jobs: | ||
pre-commit: | ||
name: Pre commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@331ce1d993939866bb63c32c6cbbfd48fa76fc57 | ||
with: | ||
go-version: '^1.18' | ||
- name: Install tools | ||
run: | | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/[email protected] | ||
test: | ||
name: Unit tests | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f | ||
- uses: actions/setup-go@331ce1d993939866bb63c32c6cbbfd48fa76fc57 | ||
with: | ||
go-version: '^1.17' | ||
go-version: '^1.18' | ||
- name: Install tools | ||
run: | | ||
sudo apt-get update | ||
|
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,9 @@ | ||
repos: | ||
- repo: https://github.com/dnephin/pre-commit-golang | ||
rev: v0.5.0 | ||
hooks: | ||
- id: go-fmt | ||
- id: golangci-lint | ||
args: [--timeout=5m] | ||
- id: go-build | ||
- id: go-mod-tidy |
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,7 @@ | ||
{ | ||
"go.coverOnSave": true, | ||
"go.coverOnSingleTest": true, | ||
"go.coverOnSingleTestFile": true, | ||
"go.lintOnSave": "workspace", | ||
"go.lintTool": "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
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.