-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add github workflows and lint config. * Make this v1, depending on wrstat v5.
- Loading branch information
Showing
21 changed files
with
352 additions
and
104 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,26 @@ | ||
name: golangci-lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.22.4 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.59.1 | ||
only-new-issues: true |
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,29 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.22.4' | ||
|
||
- name: Run tests | ||
run: make test | ||
|
||
- name: Run tests with race detection | ||
run: make race |
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,198 @@ | ||
run: | ||
deadline: 4m | ||
build-tags: | ||
- netgo | ||
modules-download-mode: readonly | ||
|
||
linters-settings: | ||
dupl: | ||
threshold: 100 | ||
errcheck: | ||
check-type-assertions: true | ||
check-blank: true | ||
exhaustive: | ||
default-signifies-exhaustive: true | ||
funlen: | ||
lines: 30 | ||
statements: 20 | ||
gocognit: | ||
min-complexity: 9 | ||
gocyclo: | ||
min-complexity: 7 | ||
gomnd: | ||
ignored-functions: | ||
- 'strconv.Parse*' | ||
govet: | ||
shadow: true | ||
enable-all: true | ||
disable-all: false | ||
disable: | ||
- fieldalignment | ||
lll: | ||
line-length: 120 | ||
misspell: | ||
locale: UK | ||
nakedret: | ||
max-func-lines: 20 | ||
nestif: | ||
min-complexity: 2 | ||
prealloc: | ||
simple: true | ||
range-loops: true | ||
for-loops: true | ||
unparam: | ||
check-exported: true | ||
unused: | ||
check-exported: false | ||
whitespace: | ||
multi-if: true | ||
multi-func: false | ||
wsl: | ||
allow-cuddle-declarations: false | ||
force-err-cuddling: true | ||
|
||
issues: | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- funlen | ||
- maintidx | ||
- contextcheck | ||
- gocognit | ||
- gocyclo | ||
- cyclop | ||
- revive | ||
- path: internal | ||
linters: | ||
- gomnd | ||
- funlen | ||
- path: cmd | ||
linters: | ||
- gochecknoinits | ||
- gochecknoglobals | ||
- dupl | ||
- forbidigo | ||
- path: version\.go | ||
linters: | ||
- forbidigo | ||
- path: ch/from\.go | ||
linters: | ||
- gci | ||
- goimports | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
new-from-rev: master | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
# defaults | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- unused | ||
# extras | ||
- containedctx | ||
- contextcheck | ||
#- copyloopvar | ||
- cyclop | ||
- dogsled | ||
- dupl | ||
- dupword | ||
- durationcheck | ||
- err113 | ||
- errchkjson | ||
- errname | ||
- errorlint | ||
- exhaustive | ||
- exportloopref | ||
- fatcontext | ||
- forbidigo | ||
- forcetypeassert | ||
- funlen | ||
- gci | ||
- gocheckcompilerdirectives | ||
- gochecknoglobals | ||
- gochecknoinits | ||
- gochecksumtype | ||
- gocognit | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- godot | ||
- godox | ||
- goimports | ||
- gosec | ||
- gosmopolitan | ||
- grouper | ||
- importas | ||
- inamedparam | ||
- interfacebloat | ||
#- intrange | ||
- ireturn | ||
- lll | ||
- maintidx | ||
- makezero | ||
- mirror | ||
- misspell | ||
- mnd | ||
- nakedret | ||
- nestif | ||
- nilerr | ||
- nilnil | ||
- nlreturn | ||
- noctx | ||
- nolintlint | ||
- nosprintfhostport | ||
- perfsprint | ||
- prealloc | ||
- predeclared | ||
- reassign | ||
- revive | ||
- sloglint | ||
- stylecheck | ||
- tagalign | ||
- tenv | ||
- thelper | ||
- tparallel | ||
- unconvert | ||
- unparam | ||
- usestdlibvars | ||
- wastedassign | ||
- whitespace | ||
- wsl | ||
|
||
#disable: | ||
# - asasalint | ||
# - asciicheck | ||
# - bidichk | ||
# - bodyclose | ||
# - canonicalheader | ||
# - decorder | ||
# - depguard | ||
# - exhaustruct | ||
# - ginkgolinter | ||
# - gofmt | ||
# - gofumpt | ||
# - goheader | ||
# - gomoddirectives | ||
# - gomodguard | ||
# - goprintffuncname | ||
# - loggercheck | ||
# - musttag | ||
# - nonamedreturns | ||
# - paralleltest | ||
# - promlinter | ||
# - protogetter | ||
# - rowserrcheck | ||
# - spancheck | ||
# - sqlclosecheck | ||
# - tagliatelle | ||
# - testableexamples | ||
# - testifylint | ||
# - testpackage | ||
# - varnamelen | ||
# - wrapcheck | ||
# - zerologlint |
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
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.