mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
added: gofmt check over the existing github workflows (#1553)
* added: gofmt check over the existing github workflows Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com> * added: gofmt check with logs added Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
This commit is contained in:
parent
b9a64ea41d
commit
426475b16c
3 changed files with 21 additions and 1 deletions
10
.github/workflows/build.yaml
vendored
10
.github/workflows/build.yaml
vendored
|
@ -30,6 +30,16 @@ jobs:
|
|||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: gofmt check
|
||||
run: |
|
||||
if [ "$(gofmt -s -l . | wc -l)" -ne 0 ]
|
||||
then
|
||||
echo "The following files were found to be not go formatted:"
|
||||
gofmt -s -l .
|
||||
echo "Please run 'make fmt' to go format the above files."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: golangci-lint
|
||||
uses: reviewdog/action-golangci-lint@v1
|
||||
|
||||
|
|
10
.github/workflows/e2e.yaml
vendored
10
.github/workflows/e2e.yaml
vendored
|
@ -39,6 +39,16 @@ jobs:
|
|||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: gofmt check
|
||||
run: |
|
||||
if [ "$(gofmt -s -l . | wc -l)" -ne 0 ]
|
||||
then
|
||||
echo "The following files were found to be not go formatted:"
|
||||
gofmt -s -l .
|
||||
echo "Please run 'make fmt' to go format the above files."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: golangci-lint
|
||||
uses: reviewdog/action-golangci-lint@v1
|
||||
|
|
2
Makefile
2
Makefile
|
@ -208,7 +208,7 @@ endif
|
|||
|
||||
# Run go fmt against code
|
||||
fmt:
|
||||
go fmt ./...
|
||||
gofmt -s -w .
|
||||
|
||||
vet:
|
||||
go vet ./...
|
||||
|
|
Loading…
Add table
Reference in a new issue