Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

tests:
name: Tests
uses: DWSR/actions/.github/workflows/go-test-single.yml@main
uses: DWSR/actions/.github/workflows/go-test-matrix.yml@main

autoapprove-dependabot:
name: Auto-approve Dependabot PRs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:

tests:
name: Tests
uses: DWSR/actions/.github/workflows/go-test-single.yml@main
uses: DWSR/actions/.github/workflows/go-test-matrix.yml@main
263 changes: 263 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
run:
timeout: 5m
output:
formats:
- format: colored-line-number
issues:
uniq-by-line: false
exclude-use-default: false
exclude:
- EXC0001
- EXC0003
- EXC0004
- EXC0005
- EXC0006
- EXC0007
- EXC0008
- EXC0009
- EXC0011
- EXC0010
- EXC0013
exclude-rules:
- text: "import-shadowing: The name 'require' shadows an import name"
linters:
- revive
- text: should have a package comment
path: main.go
linters:
- revive
- text: package comment should be of the form "(.+)...
linters:
- stylecheck
- revive
- path: "(.+)_test.go"
linters:
- dupl
- funlen
- err113
linters:
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- cyclop
- decorder
- depguard
- dogsled
- dupl
- dupword
- durationcheck
- err113
- errchkjson
- errname
- errorlint
- exhaustive
- forbidigo
- forcetypeassert
- funlen
- gci
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoinits
- gochecksumtype
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- gofumpt
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosmopolitan
- grouper
- importas
- inamedparam
- interfacebloat
- ireturn
- lll
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- mnd
- musttag
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- nosprintfhostport
- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- stylecheck
- tagalign
- tagliatelle
- testableexamples
- testifylint
- testpackage
- unconvert
- unparam
- usestdlibvars
- usetesting
- varnamelen
- whitespace
- wsl

linters-settings:
depguard:
rules:
main:
list-mode: lax
deny:
- pkg: github.com/pkg/errors
desc: Should be replaced by stdlib errors package
gci:
sections:
- standard
- default
- localmodule
custom-order: true
decorder:
ignore-underscore-vars: true
disable-dec-order-check: false
disable-init-func-first-check: false
disable-dec-num-check: false
disable-type-dec-num-check: false
disable-const-dec-num-check: false
disable-var-dec-num-check: false
varnamelen:
# tc: test cases for table driven tests
# t: interface for mocks in tests
ignore-names: [tc, t]
ignore-decls:
- "w http.ResponseWriter"
- "r *http.Request"
- "wg sync.WaitGroup"
- "eg errgroup.Group"
- "ao workflow.ActivityOptions"
revive:
ignore-generated-header: true
rules:
- name: argument-limit
- name: atomic
- name: banned-characters
- name: bare-return
- name: blank-imports
- name: bool-literal-in-expr
- name: call-to-gc
- name: comment-spacings
- name: confusing-results
- name: constant-logical-expr
- name: context-as-argument
arguments:
- allowTypesBefore: "*testing.T,*github.com/user/repo/testing.Harness"
- name: context-keys-type
- name: datarace
- name: deep-exit
- name: defer
- name: dot-imports
- name: duplicated-imports
- name: early-return
arguments:
- "preserveScope"
- name: empty-block
- name: empty-lines
- name: enforce-map-style
arguments:
- "make"
- name: enforce-repeated-arg-type-style
arguments:
- "short"
- name: enforce-slice-style
arguments:
- "make"
- name: error-naming
- name: error-return
- name: error-strings
- name: errorf
- name: exported
arguments:
- "sayRepetitiveInsteadOfStutters"
- name: flag-parameter
- name: function-result-limit
- name: get-return
- name: identical-branches
- name: if-return
- name: increment-decrement
- name: indent-error-flow
arguments:
- "preserveScope"
- name: import-alias-naming
arguments:
- "^[a-z][a-z0-9]{0,}$"
- name: import-shadowing
- name: max-control-nesting
- name: modifies-parameter
- name: modifies-value-receiver
- name: nested-structs
- name: optimize-operands-order
- name: package-comments
- name: range
- name: range-val-in-closure
- name: range-val-address
- name: receiver-naming
- name: redundant-import-alias
- name: redefines-builtin-id
- name: string-of-int
- name: struct-tag
arguments:
- "json,inline"
- "bson,outline,gnu"
- name: superfluous-else
arguments:
- "preserveScope"
- name: time-equal
- name: time-naming
- name: var-declaration
- name: unconditional-recursion
- name: unexported-naming
- name: unexported-return
- name: unhandled-error
- name: unnecessary-stmt
- name: unreachable-code
- name: unused-parameter
arguments:
- allowRegex: "^_"
- name: unused-receiver
- name: useless-break
- name: waitgroup-by-value
wsl:
# Allow cuddling with logging calls
allow-cuddle-with-calls: ["Lock", "RLock", "Info", "Debug", "Warn", "Error"]
funlen:
ignore-comments: true
stylecheck:
checks: ["all", "-ST1003"]
usetesting:
os-setenv: true
os-temp-dir: true
4 changes: 4 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[tools]
go = "latest"
"go:github.com/mitranim/gow" = "latest"
"go:gotest.tools/gotestsum" = "latest"
8 changes: 7 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ module github.com/DWSR/kubeassert-go
go 1.24.0

require (
github.com/google/go-cmp v0.6.0
github.com/stretchr/testify v1.10.0
k8s.io/api v0.32.2
k8s.io/apiextensions-apiserver v0.32.2
k8s.io/apimachinery v0.32.2
k8s.io/client-go v0.32.2
sigs.k8s.io/e2e-framework v0.6.0
sigs.k8s.io/kustomize/api v0.19.0
sigs.k8s.io/kustomize/kyaml v0.19.0
)

require (
Expand All @@ -23,14 +26,14 @@ require (
github.com/fatih/color v1.16.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
Expand All @@ -44,6 +47,7 @@ require (
github.com/moby/spdystream v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand All @@ -54,7 +58,9 @@ require (
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vladimirvivien/gexe v0.4.1 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/mod v0.21.0 // indirect
Expand Down
Loading
Loading