baseline
This commit is contained in:
parent
3b9829b208
commit
768737b759
3 changed files with 35 additions and 167 deletions
194
.golangci.yaml
194
.golangci.yaml
|
|
@ -1,169 +1,37 @@
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
default: all
|
default: none
|
||||||
disable:
|
|
||||||
# TODO: Tweak for current project needs
|
|
||||||
- containedctx
|
|
||||||
- cyclop
|
|
||||||
- depguard
|
|
||||||
- dupword
|
|
||||||
- goerr113
|
|
||||||
- exhaustruct
|
|
||||||
- gochecknoglobals
|
|
||||||
- godot
|
|
||||||
- ireturn
|
|
||||||
- nlreturn
|
|
||||||
- noctx
|
|
||||||
- nonamedreturns
|
|
||||||
- tagliatelle
|
|
||||||
- testpackage
|
|
||||||
- varnamelen
|
|
||||||
- wrapcheck
|
|
||||||
- wsl
|
|
||||||
|
|
||||||
# TODO: Disabled, because they are failing at the moment, we should fix them and enable (step by step)
|
|
||||||
- contextcheck
|
|
||||||
- errcheck
|
|
||||||
- errchkjson
|
|
||||||
- errorlint
|
|
||||||
- exhaustive
|
|
||||||
- forbidigo
|
|
||||||
- forcetypeassert
|
|
||||||
- funlen
|
|
||||||
- gochecknoinits
|
|
||||||
- gocognit
|
|
||||||
- goconst
|
|
||||||
- gocritic
|
|
||||||
- gocyclo
|
|
||||||
- godox
|
|
||||||
- gosec
|
|
||||||
- ineffassign
|
|
||||||
- lll
|
|
||||||
- maintidx
|
|
||||||
- gomnd
|
|
||||||
- nestif
|
|
||||||
- nilnil
|
|
||||||
- paralleltest
|
|
||||||
- perfsprint
|
|
||||||
- revive
|
|
||||||
- staticcheck
|
|
||||||
- tagalign
|
|
||||||
- testifylint
|
|
||||||
- thelper
|
|
||||||
- unparam
|
|
||||||
- usestdlibvars
|
|
||||||
settings:
|
|
||||||
gomoddirectives:
|
|
||||||
replace-allow-list:
|
|
||||||
- github.com/bwmarrin/discordgo
|
|
||||||
errcheck:
|
|
||||||
check-type-assertions: true
|
|
||||||
check-blank: true
|
|
||||||
exhaustive:
|
|
||||||
default-signifies-exhaustive: true
|
|
||||||
funlen:
|
|
||||||
lines: 120
|
|
||||||
statements: 40
|
|
||||||
gocognit:
|
|
||||||
min-complexity: 25
|
|
||||||
gocyclo:
|
|
||||||
min-complexity: 20
|
|
||||||
govet:
|
|
||||||
enable-all: true
|
|
||||||
disable:
|
|
||||||
- fieldalignment
|
|
||||||
lll:
|
|
||||||
line-length: 120
|
|
||||||
tab-width: 4
|
|
||||||
misspell:
|
|
||||||
locale: US
|
|
||||||
gomnd:
|
|
||||||
checks:
|
|
||||||
- argument
|
|
||||||
- assign
|
|
||||||
- case
|
|
||||||
- condition
|
|
||||||
- operation
|
|
||||||
- return
|
|
||||||
nakedret:
|
|
||||||
max-func-lines: 3
|
|
||||||
revive:
|
|
||||||
enable-all-rules: true
|
|
||||||
rules:
|
|
||||||
- name: add-constant
|
|
||||||
disabled: true
|
|
||||||
- name: argument-limit
|
|
||||||
arguments:
|
|
||||||
- 7
|
|
||||||
severity: warning
|
|
||||||
- name: banned-characters
|
|
||||||
disabled: true
|
|
||||||
- name: cognitive-complexity
|
|
||||||
disabled: true
|
|
||||||
- name: comment-spacings
|
|
||||||
arguments:
|
|
||||||
- nolint
|
|
||||||
severity: warning
|
|
||||||
- name: cyclomatic
|
|
||||||
disabled: true
|
|
||||||
- name: file-header
|
|
||||||
disabled: true
|
|
||||||
- name: function-result-limit
|
|
||||||
arguments:
|
|
||||||
- 3
|
|
||||||
severity: warning
|
|
||||||
- name: function-length
|
|
||||||
disabled: true
|
|
||||||
- name: line-length-limit
|
|
||||||
disabled: true
|
|
||||||
- name: max-public-structs
|
|
||||||
disabled: true
|
|
||||||
- name: modifies-value-receiver
|
|
||||||
disabled: true
|
|
||||||
- name: package-comments
|
|
||||||
disabled: true
|
|
||||||
- name: unused-receiver
|
|
||||||
disabled: true
|
|
||||||
exclusions:
|
|
||||||
generated: lax
|
|
||||||
rules:
|
|
||||||
- linters:
|
|
||||||
- lll
|
|
||||||
source: '^//go:generate '
|
|
||||||
- linters:
|
|
||||||
- funlen
|
|
||||||
- maintidx
|
|
||||||
- gocognit
|
|
||||||
- gocyclo
|
|
||||||
path: _test\.go$
|
|
||||||
- linters:
|
|
||||||
- nolintlint
|
|
||||||
path: 'pkg/tools/(i2c\.go|spi\.go)$'
|
|
||||||
|
|
||||||
issues:
|
|
||||||
max-issues-per-linter: 0
|
|
||||||
max-same-issues: 0
|
|
||||||
|
|
||||||
formatters:
|
|
||||||
enable:
|
enable:
|
||||||
- gci
|
- gocognit
|
||||||
|
- gocyclo
|
||||||
- gofmt
|
- gofmt
|
||||||
- gofumpt
|
|
||||||
- goimports
|
- goimports
|
||||||
- golines
|
- misspell
|
||||||
settings:
|
- nakedret
|
||||||
gci:
|
|
||||||
sections:
|
linters-settings:
|
||||||
- standard
|
gocyclo:
|
||||||
- default
|
min-complexity: 30
|
||||||
- localmodule
|
gocognit:
|
||||||
custom-order: true
|
min-complexity: 30
|
||||||
gofmt:
|
gofmt:
|
||||||
simplify: true
|
simplify: true
|
||||||
rewrite-rules:
|
goimports:
|
||||||
- pattern: "interface{}"
|
local-prefixes: github.com/sipeed/picoclaw
|
||||||
replacement: "any"
|
misspell:
|
||||||
- pattern: "a[b:len(a)]"
|
locale: US
|
||||||
replacement: "a[b:]"
|
nakedret:
|
||||||
golines:
|
max-func-lines: 30
|
||||||
max-len: 120
|
|
||||||
|
run:
|
||||||
|
timeout: 30m
|
||||||
|
skip-dirs:
|
||||||
|
- vendor
|
||||||
|
- web/frontend
|
||||||
|
- scratch
|
||||||
|
- pkg/channels
|
||||||
|
- pkg/audio
|
||||||
|
- cmd/picoclaw-launcher-tui
|
||||||
|
- web/backend/api
|
||||||
|
tests: false
|
||||||
|
skip-files:
|
||||||
|
- .*_test.go
|
||||||
2
Makefile
2
Makefile
|
|
@ -295,7 +295,7 @@ update-deps:
|
||||||
@$(GO) mod tidy
|
@$(GO) mod tidy
|
||||||
|
|
||||||
## check: Run vet, fmt, lint, and verify dependencies
|
## check: Run vet, fmt, lint, and verify dependencies
|
||||||
check: deps fmt vet lint test
|
check: deps fmt vet test
|
||||||
|
|
||||||
## run: Build and run picoclaw
|
## run: Build and run picoclaw
|
||||||
run: build
|
run: build
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/sipeed/picoclaw
|
module github.com/sipeed/picoclaw
|
||||||
|
|
||||||
go 1.25.8
|
go 1.26
|
||||||
|
|
||||||
require (
|
require (
|
||||||
fyne.io/systray v1.12.0
|
fyne.io/systray v1.12.0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue