Skip to content

Commit

Permalink
KUBE-566: refactor before multi cmd (#142)
Browse files Browse the repository at this point in the history
* nojira: refactor before multi cmd

* set tls min version
  • Loading branch information
ValyaB authored Oct 18, 2024
1 parent 0bbe45a commit 18d06bc
Show file tree
Hide file tree
Showing 80 changed files with 2,349 additions and 1,621 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.7'
- uses: actions/checkout@v3
go-version: 'stable'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=5m
93 changes: 93 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
linters:
disable-all: true
enable:
- containedctx
- dogsled
- dupword
- durationcheck
- errcheck
- errname
- errorlint
- gci
- gocognit
- goconst
- gocritic
# - godot
- gofmt
- gofumpt
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
# TODO FIX THE FOLLOWING
# - misspell
# - nakedret
# - paralleltest
- revive
- sqlclosecheck
- staticcheck
# - stylecheck
- typecheck
- unconvert
- unparam
- unused
# - whitespace

linters-settings:
gocritic:
enabled-all: true
disabled-checks:
- commentFormatting
godot:
scope: all
gofumpt:
module-path: github.com/castai/cluster-controller
extra-rules: true
goconst:
min-len: 2
min-occurrences: 5
golint:
min-confidence: 0
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: [argument,case,condition,return]
govet:
# shadow is marked as experimental feature, skip it for now.
check-shadowing: false
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
lll:
line-length: 200
maligned:
suggest-new: true
misspell:
locale: US
revive:
rules:
- name: redefines-builtin-id
disabled: true

# Allow code like:
# Items: binpacking.Items{
# {
# },
# }
- name: nested-structs
disabled: true
gci:
sections:
- standard
- default
- prefix(github.com/castai/cluster-controller)
issues:
exclude-dirs:
- mock
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ push:
docker push us-docker.pkg.dev/castai-hub/library/cluster-controller:$(VERSION)

release: build push

lint:
golangci-lint run ./...
.PHONY: lint

fix:
golangci-lint run --fix ./...
.PHONY: fix

test:
go test ./... -race
.PHONY: test
214 changes: 0 additions & 214 deletions actions/actions_test.go

This file was deleted.

Loading

0 comments on commit 18d06bc

Please sign in to comment.