-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some spring cleaning stuff similarly to what went on in ironlib (#81)
- Loading branch information
Showing
15 changed files
with
152 additions
and
258 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,11 @@ | ||
--- | ||
spec: | ||
authorities: | ||
# Accept all keyless signatures validated from the public sigstore instance. | ||
# This is open source software after all. All we want to know is that the | ||
# person that did the commit has control over their email address. | ||
- keyless: | ||
url: https://fulcio.sigstore.dev | ||
# Add this if you also want to allow commits signed by GitHub. | ||
- key: | ||
kms: https://github.com/web-flow.gpg |
Validating CODEOWNERS rules …
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 @@ | ||
* @joelrebel @mmlb @splaspood @DoctorVin |
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
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 |
---|---|---|
@@ -1,211 +1,93 @@ | ||
run: | ||
# The default runtime timeout is 1m, which doesn't work well on Github Actions. | ||
timeout: 4m | ||
# | ||
# This file lives in the github.com/metal-toolbox/golangci-lint-config repo. | ||
# | ||
# Do not edit this file outside of this repo otherwise we will be grumpy. | ||
# Seriously though, this is meant to help promote a "standard" config and coding style. | ||
# If you don't like something, lets have a discussion in GitHub issues! | ||
# | ||
|
||
# NOTE: This file is populated by the lint-install tool. Local adjustments may be overwritten. | ||
linters-settings: | ||
cyclop: | ||
# NOTE: This is a very high transitional threshold | ||
max-complexity: 37 | ||
package-average: 34.0 | ||
skip-tests: true | ||
|
||
gocognit: | ||
# NOTE: This is a very high transitional threshold | ||
min-complexity: 98 | ||
|
||
dupl: | ||
threshold: 200 | ||
|
||
threshold: 125 | ||
goconst: | ||
min-len: 4 | ||
min-occurrences: 5 | ||
ignore-tests: true | ||
|
||
gosec: | ||
excludes: | ||
- G107 # Potential HTTP request made with variable url | ||
- G204 # Subprocess launched with function call as argument or cmd arguments | ||
- G404 # Use of weak random number generator (math/rand instead of crypto/rand | ||
|
||
errorlint: | ||
# these are still common in Go: for instance, exit errors. | ||
asserts: false | ||
# Forcing %w in error wrapping forces authors to make errors part of their package APIs. The decision to make | ||
# an error part of a package API should be a concious decision by the author. | ||
# Also see Hyrums Law. | ||
errorf: false | ||
|
||
exhaustive: | ||
default-signifies-exhaustive: true | ||
|
||
nestif: | ||
min-complexity: 8 | ||
|
||
nolintlint: | ||
require-explanation: true | ||
allow-unused: false | ||
require-specific: true | ||
|
||
min-len: 2 | ||
min-occurrences: 2 | ||
gocritic: | ||
enabled-tags: | ||
- experimental | ||
- performance | ||
- style | ||
disabled-checks: | ||
- whyNoLint | ||
- wrapperFunc | ||
gocyclo: | ||
min-complexity: 15 | ||
gofumpt: | ||
extra-rules: true | ||
govet: | ||
enable: | ||
- shadow | ||
lll: | ||
line-length: 140 | ||
misspell: | ||
locale: US | ||
revive: | ||
ignore-generated-header: true | ||
severity: warning | ||
rules: | ||
- name: atomic | ||
- name: blank-imports | ||
- name: bool-literal-in-expr | ||
- name: confusing-naming | ||
- name: constant-logical-expr | ||
- name: context-as-argument | ||
- name: context-keys-type | ||
- name: deep-exit | ||
- name: defer | ||
- name: range-val-in-closure | ||
- name: range-val-address | ||
- name: dot-imports | ||
- name: error-naming | ||
- name: error-return | ||
- name: error-strings | ||
- name: errorf | ||
- name: exported | ||
- name: identical-branches | ||
- name: if-return | ||
- name: import-shadowing | ||
- name: increment-decrement | ||
- name: indent-error-flow | ||
- name: indent-error-flow | ||
- name: package-comments | ||
- name: range | ||
- name: receiver-naming | ||
- name: redefines-builtin-id | ||
- name: superfluous-else | ||
- name: struct-tag | ||
- name: time-naming | ||
- name: unexported-naming | ||
- name: unexported-return | ||
- name: unnecessary-stmt | ||
- name: unreachable-code | ||
- name: unused-parameter | ||
- name: var-declaration | ||
- name: var-naming | ||
- name: unconditional-recursion | ||
- name: waitgroup-by-value | ||
|
||
staticcheck: | ||
go: "1.18" | ||
|
||
unused: | ||
go: "1.18" | ||
|
||
output: | ||
sort-results: true | ||
confidence: 0 | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- asciicheck | ||
- bodyclose | ||
enable-all: true | ||
disable-all: false | ||
# Linters we don't like | ||
# Comments help explain why its disabled or point at ones we should not disable but will take a little work | ||
# If its not commented its likely because its just too annoying or we don't find useful | ||
disable: | ||
- copyloopvar # requires go >=1.22 | ||
- cyclop | ||
#- deadcode | ||
- dogsled | ||
- dupl | ||
- durationcheck | ||
- errcheck | ||
- errname | ||
- errorlint | ||
- exhaustive | ||
- exportloopref | ||
- forcetypeassert | ||
- deadcode # deprecated | ||
- depguard | ||
- errname # maybe should be enabled | ||
- exhaustivestruct # deprecated | ||
- exhaustruct | ||
- forbidigo | ||
- funlen | ||
- gochecknoglobals | ||
- gochecknoinits | ||
- gocognit | ||
- goconst | ||
- gocritic | ||
- godot | ||
- gofmt | ||
- gofumpt | ||
- gosec | ||
- goheader | ||
- goimports | ||
- goprintffuncname | ||
- gosimple | ||
- govet | ||
#- ifshort | ||
- importas | ||
- ineffassign | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- godox | ||
- golint # deprecated | ||
- gomnd | ||
- ifshort # deprecated | ||
- inamedparam | ||
- interfacebloat | ||
- interfacer # deprecated | ||
- intrange # requires go >=1.22 | ||
- ireturn # should be enabled, ironlib needs some changes | ||
- lll # not previously enabled, ironlib and mctl both fail this | ||
- maligned # deprecated | ||
- nestif | ||
- nilerr | ||
- noctx | ||
- nilnil | ||
- nlreturn | ||
- nolintlint | ||
- predeclared | ||
# disabling for the initial iteration of the linting tool | ||
# - promlinter | ||
- revive | ||
#- rowserrcheck | ||
#- sqlclosecheck | ||
- staticcheck | ||
#- structcheck | ||
- stylecheck | ||
- thelper | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
#- varcheck | ||
#- wastedassign | ||
- whitespace | ||
|
||
# Disabled linters, due to being misaligned with Go practices | ||
# - exhaustivestruct | ||
# - gochecknoglobals | ||
# - gochecknoinits | ||
# - goconst | ||
# - godox | ||
# - goerr113 | ||
# - gomnd | ||
# - lll | ||
# - nlreturn | ||
# - testpackage | ||
# - wsl | ||
# Disabled linters, due to not being relevant to our code base: | ||
# - maligned | ||
# - prealloc "For most programs usage of prealloc will be a premature optimization." | ||
# Disabled linters due to bad error messages or bugs | ||
# - tagliatelle | ||
- nonamedreturns # should be enabled, probably | ||
- nosnakecase # deprecated | ||
- paralleltest | ||
- perfsprint | ||
- scopelint # deprecated | ||
- structcheck # deprecated | ||
- tagliatelle | ||
- tenv # should be enabled | ||
- testpackage | ||
- testifylint # should be enabled | ||
- thelper # should be enabled | ||
- varcheck # deprecated | ||
- varnamelen | ||
- wrapcheck | ||
- wsl | ||
|
||
issues: | ||
# Excluding configuration per-path, per-linter, per-text and per-source | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- dupl | ||
- errcheck | ||
- forcetypeassert | ||
- gocyclo | ||
- gosec | ||
- noctx | ||
|
||
- path: .*cmd.* | ||
linters: | ||
- noctx | ||
|
||
- path: main\.go | ||
linters: | ||
- noctx | ||
|
||
- path: .*cmd.* | ||
text: "deep-exit" | ||
|
||
- path: main\.go | ||
text: "deep-exit" | ||
|
||
# This check is of questionable value | ||
- linters: | ||
- tparallel | ||
text: "call t.Parallel on the top level as well as its subtests" | ||
|
||
# Don't hide lint issues just because there are many of them | ||
max-same-issues: 0 | ||
max-issues-per-linter: 0 | ||
- stylecheck | ||
text: "ST1016" |
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 |
---|---|---|
|
@@ -17,7 +17,10 @@ build: | |
-X $(LDFLAG_LOCATION).Version=$(VERSION) \ | ||
-X $(LDFLAG_LOCATION).BuildDate=$(BUILD_DATE)" | ||
lint: | ||
golangci-lint run --config .golangci.yml --timeout=5m --out-${NO_FUTURE}format colored-line-number | ||
go run github.com/golangci/golangci-lint/cmd/[email protected] run --config .golangci.yml --timeout=5m --out-format colored-line-number | ||
|
||
lint-fix: | ||
go run github.com/golangci/golangci-lint/cmd/[email protected] run --fix --config .golangci.yml --timeout=5m --out-format colored-line-number | ||
|
||
test: lint | ||
CGO_ENABLED=0 $(GOBINARY) test -timeout 1m -v -covermode=atomic ./... |
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.