-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
6 changed files
with
55 additions
and
19 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,18 @@ | ||
# This action runs golangci-lint using Makefile. | ||
# It ensures the same version of golangci-lint is used in CI as in local development. | ||
name: golangci-lint | ||
description: 'Run golangci-lint' | ||
inputs: | ||
working-directory: | ||
description: 'Working directory' | ||
required: false | ||
default: '.' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Run golangci-lint | ||
run: | | ||
echo "::add-matcher::${{ inputs.working-directory }}/.github/actions/golangci-lint/matcher.json" | ||
make lint | ||
echo "::remove-matcher owner=golangci-lint::" | ||
shell: bash |
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 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "golangci-lint-colored-line-number", | ||
"severity": "error", | ||
"pattern": [ | ||
{ | ||
"regexp": "^([^:]+):(\\d+):(?:(\\d+):)?\\s+(.+ \\(.+\\))$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4 | ||
} | ||
] | ||
} | ||
] | ||
} |
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 |
---|---|---|
|
@@ -24,4 +24,4 @@ | |
# Local History for Visual Studio Code | ||
.history/ | ||
|
||
./certyaml | ||
certyaml |
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,14 @@ | ||
linters: | ||
# https://golangci-lint.run/usage/linters/#enabled-by-default | ||
enable: | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- unused | ||
- gosec | ||
- gofmt | ||
- goimports | ||
- misspell | ||
- revive |
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 |
---|---|---|
@@ -1,21 +1,18 @@ | ||
all: check build | ||
|
||
check: test lint | ||
|
||
test: | ||
go test --race -v ./... | ||
|
||
check: test | ||
golangci-lint run | ||
gosec -quiet ./... | ||
lint: | ||
go run github.com/golangci/golangci-lint/cmd/[email protected] run | ||
|
||
build: | ||
go build -v ./cmd/certyaml | ||
|
||
install: | ||
go install -v ./cmd/certyaml | ||
|
||
install-tools: | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
go install github.com/securego/gosec/v2/cmd/[email protected] | ||
|
||
update-modules: | ||
go get -u -t ./... && go mod tidy |