Skip to content

Commit

Permalink
fix: linter (#4)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
  • Loading branch information
eddycharly authored Oct 3, 2023
1 parent a7afb3e commit 6558f94
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 17 deletions.
19 changes: 4 additions & 15 deletions .github/workflow/lint.yaml → .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Lint

permissions: {}
# permissions: {}

on:
push:
branches:
- '*'
pull_request:
branches:
- 'main'
Expand All @@ -21,16 +18,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ~1.21.1
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
version: v1.54.2
skip-cache: true
- name: go fmt check
run: make fmt-check
- name: goimports check
run: make imports-check
- name: Checking unused pkgs using go mod tidy
run: make unused-package-check
- name: Go vet
run: make vet
45 changes: 45 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- decorder
- dogsled
- durationcheck
- errcheck
- errname
- exportloopref
- gci
- gochecknoinits
- gofmt
- gofumpt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- grouper
- importas
- ineffassign
- makezero
- misspell
- noctx
- nolintlint
- nosprintfhostport
# - paralleltest
- staticcheck
- tenv
- thelper
- tparallel
- typecheck
- unconvert
- unused
- wastedassign
- whitespace

run:
timeout: 15m
skip-files:
- ".+\\.generated.go"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/kyverno/kyverno-json
go 1.21

require (
github.com/jinzhu/copier v0.4.0
github.com/jmespath-community/go-jmespath v1.1.1
github.com/kyverno/kyverno v1.5.0-rc1.0.20230927190803-27858f634e28
github.com/spf13/cobra v1.7.0
Expand Down Expand Up @@ -154,7 +155,6 @@ require (
github.com/in-toto/in-toto-golang v0.9.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/assert/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Parse(assertion interface{}) Assertion {
}

// mapNode is the assertion type represented by a map.
// it is reponsible for projecting the analysed resource and passing the result to the descendant
// it is responsible for projecting the analysed resource and passing the result to the descendant
type mapNode map[interface{}]Assertion

func (n mapNode) assert(path *field.Path, value interface{}, bindings jpbinding.Bindings) (field.ErrorList, error) {
Expand Down

0 comments on commit 6558f94

Please sign in to comment.