-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go: implements golangci-lint makefile target & GitHub actions workflow
Now, when `cargo make check-lints` is run, golangci-lint will run on all go modules via docker with a `.golangci.yaml` config file. Adds workflow for Go linting when Go files change. Avoids running Go lints in our GitHub actions build. Fixes the following Go linting errors: - Unnecessary `fmt.Sprintf` - Fix `Https` var name with `HTTPS` - Fix un-`goimports`-ed test file Signed-off-by: John McBride <[email protected]>
- Loading branch information
Showing
6 changed files
with
80 additions
and
11 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
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,29 @@ | ||
name: golangci-lint | ||
on: | ||
pull_request: | ||
branches: [develop] | ||
# Only run this workflow if Go files have been modified | ||
paths: | ||
- '**.go' | ||
- '*/go.mod' | ||
- '*/go.sum' | ||
|
||
jobs: | ||
golangci-lint: | ||
name: lint | ||
runs-on: [self-hosted, linux, x64] | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- uses: actions/checkout@v3 | ||
- name: lint-host-ctr | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
working-directory: sources/host-ctr | ||
- name: lint-ecs-gpu-init | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
working-directory: sources/ecs-gpu-init |
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 @@ | ||
linters: | ||
enable: | ||
- errcheck | ||
- goimports | ||
- ineffassign | ||
- misspell | ||
- revive | ||
- staticcheck | ||
- unconvert | ||
- unused | ||
- vet | ||
|
||
run: | ||
timeout: 3m | ||
skip-dirs: | ||
- vendor | ||
- .gomodcache |
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