Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
341 changes: 170 additions & 171 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,177 +1,176 @@
version: "2"
run:
tests: true

linters-settings:
gofmt:
simplify: true
goimports:
local-prefixes: github.com/iotaledger
tests: true
linters:
default: none
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- copyloopvar
- decorder
- depguard
- dogsled
- dupl
- dupword
- durationcheck
- err113
- errcheck
- errchkjson
- errname
- errorlint
- forcetypeassert
- ginkgolinter
- gocheckcompilerdirectives
- goconst
- godot
- goheader
- gomodguard
- goprintffuncname
- gosec
- gosmopolitan
- govet
- grouper
- importas
- inamedparam
- ineffassign
- intrange
- loggercheck
- makezero
- mirror
- misspell
- musttag
- nakedret
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
- nosprintfhostport
- paralleltest
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- tagliatelle
- testableexamples
- testifylint
- testpackage
- thelper
- tparallel
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
settings:
depguard:
rules:
main:
files:
- '!**/ierrors.go'
- '!**/ierrors_no_stacktrace.go'
deny:
- pkg: errors
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package
- pkg: golang.org/x/xerrors
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package
- pkg: github.com/pkg/errors
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package
gocyclo:
min-complexity: 15
min-complexity: 15
govet:
disable:
- shadow
disable:
- shadow
misspell:
locale: US
staticcheck:
checks: ["all"]
locale: US
nlreturn:
block-size: 2
stylecheck:
initialisms: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]
depguard:
rules:
main:
# exclude the ierrors.go file itself
files:
- "!**/ierrors.go"
- "!**/ierrors_no_stacktrace.go"
deny:
- pkg: "errors"
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package
- pkg: "golang.org/x/xerrors"
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package
- pkg: "github.com/pkg/errors"
desc: Should be replaced with "github.com/iotaledger/hive.go/ierrors" package

linters:
# Disable all linters.
disable-all: true
# Enable specific linter
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- asasalint
- asciicheck
- bidichk
- bodyclose
#- containedctx
#- contextcheck # this linter is buggy and renders all nolint rules useless
- copyloopvar
#- cyclop
- decorder
- depguard
- dogsled
- dupl
- dupword
- durationcheck
- errchkjson
- errname
- errorlint
- execinquery
#- exhaustive
#- exhaustruct
- exportloopref
#- forbidigo
- forcetypeassert
#- funlen
#- gci
- ginkgolinter
- gocheckcompilerdirectives
#- gochecknoglobals
#- gochecknoinits
#- gochecksumtype
#- gocognit
- goconst
#- gocritic
#- gocyclo
- godot
#- godox
- goerr113
- gofmt
#- gofumpt
- goheader
- goimports
#- gomnd
#- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosmopolitan
- grouper
- importas
- inamedparam
#- interfacebloat
- intrange
#- ireturn
#- lll
- loggercheck
#- maintidx
- makezero
- mirror
- misspell
- musttag
- nakedret
#- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nolintlint
#- nonamedreturns
- nosprintfhostport
- paralleltest
#- perfsprint
- prealloc
- predeclared
- promlinter
- protogetter
- reassign
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- stylecheck
#- tagalign
- tagliatelle
- tenv
- testableexamples
- testifylint
- testpackage
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
#- varnamelen
- wastedassign
- whitespace
#- wrapcheck
#- wsl
- zerologlint

block-size: 2
staticcheck:
checks:
- all
initialisms:
- ACL
- API
- ASCII
- CPU
- CSS
- DNS
- EOF
- GUID
- HTML
- HTTP
- HTTPS
- ID
- IP
- JSON
- QPS
- RAM
- RPC
- SLA
- SMTP
- SQL
- SSH
- TCP
- TLS
- TTL
- UDP
- UI
- GID
- UID
- UUID
- URI
- URL
- UTF8
- VM
- XML
- XMPP
- XSRF
- XSS
- SIP
- RTP
- AMQP
- DB
- TS
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- .*_test.go$
- third_party$
- builtin$
- examples$
issues:
exclude-files:
- ".*_test.go$"
# Maximum issues count per one linter.
# Set to 0 to disable.
# Default: 50
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 0
#exclude:
# - 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked' # errcheck
# - "err113: do not define dynamic errors, use wrapped static errors instead:" # goerr113
# - "type name will be used as [0-9A-Za-z_.]+ by other packages, and that stutters; consider calling this" # golint
# - "Potential file inclusion via variable" # gosec
# - "G404: Use of weak random number generator" # gosec
# - "Subprocess launch(ed with variable|ing should be audited)" # gosec
# - "Use of unsafe calls should be audited" # gosec
# - "G108: Profiling endpoint is automatically exposed on /debug/pprof" # gosec
# - "(Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)" # gosec
# - "G101: Potential hardcoded credentials" # gosec
# - "(G104|G307)" # gosec Duplicated errcheck checks.
# - "`[0-9A-Za-z_.]+` - `[0-9A-Za-z_.]+` always receives `[0-9A-Za-z_.]+`" # unparam
# - "should have comment .*or be unexported" # revive
# - "exported: comment on exported" # revive
# - "package-comments: package comment should be of the form" # revive
# - "blank-imports" # revive
# - "var-naming: don't use leading k in Go names;" #revive
# - 'shadow: declaration of "err"' # govet
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gofmt
- goimports
settings:
gofmt:
simplify: true
goimports:
local-prefixes:
- github.com/iotaledger
exclusions:
generated: lax
paths:
- .*_test.go$
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion web/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/iotaledger/hive.go/web
go 1.22

require (
github.com/coder/websocket v1.8.13
github.com/iotaledger/hive.go/constraints v0.0.0-20240517131232-748f1ce3a2d2
github.com/iotaledger/hive.go/ds v0.0.0-20240517131232-748f1ce3a2d2
github.com/iotaledger/hive.go/ierrors v0.0.0-20240517131232-748f1ce3a2d2
Expand All @@ -11,7 +12,6 @@ require (
github.com/iotaledger/hive.go/runtime v0.0.0-20240517131232-748f1ce3a2d2
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.23.0
nhooyr.io/websocket v1.8.11
)

require (
Expand Down
6 changes: 4 additions & 2 deletions web/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
github.com/btcsuite/btcd/btcec/v2 v2.2.1 h1:xP60mv8fvp+0khmrN0zTdPC3cNm24rfeE6lh2R/Yv3E=
github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8=
github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo=
github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9FE=
github.com/coder/websocket v1.8.13/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -56,5 +60,3 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
nhooyr.io/websocket v1.8.11 h1:f/qXNc2/3DpoSZkHt1DQu6rj4zGC8JmkkLkWss0MgN0=
nhooyr.io/websocket v1.8.11/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c=
4 changes: 2 additions & 2 deletions web/websockethub/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"sync/atomic"
"time"

"nhooyr.io/websocket"
"nhooyr.io/websocket/wsjson"
"github.com/coder/websocket"
"github.com/coder/websocket/wsjson"

"github.com/iotaledger/hive.go/log"
"github.com/iotaledger/hive.go/runtime/timeutil"
Expand Down
2 changes: 1 addition & 1 deletion web/websockethub/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"sync/atomic"

"nhooyr.io/websocket"
"github.com/coder/websocket"

"github.com/iotaledger/hive.go/ierrors"
"github.com/iotaledger/hive.go/log"
Expand Down
Loading