-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from narcis96/narcis/update_logger
- Loading branch information
Showing
2,647 changed files
with
407,905 additions
and
17,977 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,46 @@ | ||
name: golangci-lint | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
paths: | ||
- "**/*.go" | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
pull-requests: read | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GOPRIVATE: "github.com/loft-sh/*" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: "go.mod" | ||
cache: false | ||
|
||
- name: Build logcheck plugin | ||
run: go build -o "tools/logcheck.so" -mod=vendor -buildmode=plugin sigs.k8s.io/logtools/logcheck/plugin | ||
env: | ||
GOWORK: off | ||
|
||
- name: Build golangci-lint | ||
run: go build -o "tools/golangci-lint" -mod=vendor ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint | ||
|
||
- name: Run golangci-lint | ||
run: tools/golangci-lint run --out-format=github-actions ./... | ||
env: | ||
LOGCHECK_CONFIG: hack/logcheck.conf |
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 |
---|---|---|
|
@@ -30,4 +30,6 @@ testbin/* | |
# devlopment tmp files | ||
/.devspace/ | ||
devvalues.yaml | ||
kubeconfig.yaml | ||
kubeconfig.yaml | ||
|
||
/tools |
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,101 @@ | ||
run: | ||
timeout: 15m | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- asasalint | ||
- asciicheck | ||
- bidichk | ||
- decorder | ||
- dupl | ||
- durationcheck | ||
- errcheck | ||
- errchkjson | ||
- errname | ||
- errorlint | ||
- exhaustive | ||
- exportloopref | ||
- ginkgolinter | ||
- gocheckcompilerdirectives | ||
- gocritic | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- grouper | ||
- importas | ||
- ineffassign | ||
- logcheck | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nilnil | ||
- prealloc | ||
- promlinter | ||
- revive | ||
- staticcheck | ||
- stylecheck | ||
- tagalign | ||
- typecheck | ||
- unconvert | ||
- unused | ||
- usestdlibvars | ||
- whitespace | ||
|
||
# next linters to be enabled: | ||
|
||
# linters to be enabled in the distant future: | ||
# - cyclop | ||
# - dupl | ||
# - funlen | ||
# - interfacebloat | ||
# - predeclared | ||
# - stylecheck | ||
# - wrapcheck | ||
|
||
linters-settings: | ||
custom: | ||
logcheck: | ||
path: tools/logcheck.so | ||
description: structured logging checker | ||
original-url: sigs.k8s.io/logtools/logcheck | ||
|
||
gofmt: | ||
simplify: true | ||
|
||
dupl: | ||
threshold: 400 | ||
|
||
exhaustive: | ||
check: | ||
- switch | ||
- map | ||
ignore-enum-types: "ResourceName|Atom" | ||
default-signifies-exhaustive: true | ||
|
||
importas: | ||
no-unaliased: true | ||
alias: | ||
# Kubernetes | ||
- pkg: k8s\.io/api/(\w+)/(v[\w\d]+) | ||
alias: $1$2 | ||
- pkg: k8s\.io/apimachinery/pkg/api/(\w+)/(v[\w\d]+) | ||
alias: $1$2 | ||
- pkg: k8s.io/apimachinery/pkg/api/errors | ||
alias: kerrors | ||
- pkg: k8s.io/apimachinery/pkg/apis/meta/internalversion | ||
alias: metainternalversion | ||
|
||
tagalign: | ||
order: | ||
- json | ||
- yaml | ||
- xml | ||
- form | ||
|
||
issues: | ||
# Maximum issues count per one linter. Set to 0 to disable. Default is 50. | ||
max-issues-per-linter: 0 | ||
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3. | ||
max-same-issues: 0 |
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
Oops, something went wrong.