Update dependencies (#2180)
* Update dependencies * Fix whatsmeow API changes
This commit is contained in:
81
vendor/github.com/lrstanley/girc/.golangci.yml
generated
vendored
81
vendor/github.com/lrstanley/girc/.golangci.yml
generated
vendored
@@ -10,8 +10,7 @@ run:
|
||||
timeout: 3m
|
||||
|
||||
issues:
|
||||
max-per-linter: 0
|
||||
# max-same-issues: 0
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 50
|
||||
|
||||
exclude-rules:
|
||||
@@ -44,18 +43,21 @@ linters:
|
||||
- asciicheck # checks that your code does not contain non-ASCII identifiers
|
||||
- bidichk # checks for dangerous unicode character sequences
|
||||
- bodyclose # checks whether HTTP response body is closed successfully
|
||||
- canonicalheader # checks whether net/http.Header uses canonical header
|
||||
- copyloopvar # detects places where loop variables are copied
|
||||
- cyclop # checks function and package cyclomatic complexity
|
||||
- dupl # tool for code clone detection
|
||||
- durationcheck # checks for two durations multiplied together
|
||||
- errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases
|
||||
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
|
||||
- execinquery # checks query string in Query function which reads your Go src files and warning it finds
|
||||
- exportloopref # checks for pointers to enclosing loop variables
|
||||
- fatcontext # detects nested contexts in loops
|
||||
- forbidigo # forbids identifiers
|
||||
- funlen # tool for detection of long functions
|
||||
- gci # controls golang package import order and makes it always deterministic
|
||||
- gocheckcompilerdirectives # validates go compiler directive comments (//go:)
|
||||
- gochecknoinits # checks that no init functions are present in Go code
|
||||
- gochecksumtype # checks exhaustiveness on Go "sum types"
|
||||
- goconst # finds repeated strings that could be replaced by a constant
|
||||
- gocritic # provides diagnostics that check for bugs, performance and style issues
|
||||
- gocyclo # computes and checks the cyclomatic complexity of functions
|
||||
@@ -69,6 +71,7 @@ linters:
|
||||
- gosimple # specializes in simplifying a code
|
||||
- govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
|
||||
- ineffassign # detects when assignments to existing variables are not used
|
||||
- intrange # finds places where for loops could make use of an integer range
|
||||
- loggercheck # checks key value pairs for common logger libraries (kitlog,klog,logr,zap)
|
||||
- makezero # finds slice declarations with non-zero initial length
|
||||
- misspell # finds commonly misspelled words
|
||||
@@ -78,16 +81,20 @@ linters:
|
||||
- nilnil # checks that there is no simultaneous return of nil error and an invalid value
|
||||
- noctx # finds sending http request without context.Context
|
||||
- nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL
|
||||
- perfsprint # checks that fmt.Sprintf can be replaced with a faster alternative
|
||||
- predeclared # finds code that shadows one of Go's predeclared identifiers
|
||||
- promlinter # checks Prometheus metrics naming via promlint
|
||||
- reassign # checks that package variables are not reassigned
|
||||
- revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint
|
||||
- rowserrcheck # checks whether Err of rows is checked successfully
|
||||
- sloglint # ensure consistent code style when using log/slog
|
||||
- sqlclosecheck # checks that sql.Rows and sql.Stmt are closed
|
||||
- staticcheck # is a go vet on steroids, applying a ton of static analysis checks
|
||||
- stylecheck # is a replacement for golint
|
||||
# - tagalign # aligns struct tags -- disable for now (https://github.com/4meepo/tagalign/issues/13)
|
||||
- tenv # detects using os.Setenv instead of t.Setenv since Go1.17
|
||||
- testableexamples # checks if examples are testable (have an expected output)
|
||||
- testifylint # checks usage of github.com/stretchr/testify
|
||||
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
|
||||
- typecheck # like the front-end of a Go compiler, parses and type-checks Go code
|
||||
- unconvert # removes unnecessary type conversions
|
||||
@@ -97,15 +104,6 @@ linters:
|
||||
- wastedassign # finds wasted assignment statements
|
||||
- whitespace # detects leading and trailing whitespace
|
||||
|
||||
# disabled for now:
|
||||
# - gomnd # detects magic numbers
|
||||
# - errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
|
||||
# - gochecknoglobals # checks that no global variables exist
|
||||
# - gocognit # computes and checks the cognitive complexity of functions
|
||||
# - nestif # reports deeply nested if statements
|
||||
# - nonamedreturns # reports all named returns
|
||||
# - testpackage # makes you use a separate _test package
|
||||
|
||||
linters-settings:
|
||||
cyclop:
|
||||
# The maximal code complexity to report.
|
||||
@@ -121,15 +119,11 @@ linters-settings:
|
||||
|
||||
funlen:
|
||||
# Checks the number of lines in a function.
|
||||
# If lower than 0, disable the check.
|
||||
lines: 150
|
||||
# Checks the number of statements in a function.
|
||||
# If lower than 0, disable the check.
|
||||
statements: 75
|
||||
|
||||
# gocognit:
|
||||
# # Minimal code complexity to report.
|
||||
# min-complexity: 25
|
||||
# Ignore comments.
|
||||
ignore-comments: true
|
||||
|
||||
gocritic:
|
||||
disabled-checks:
|
||||
@@ -150,20 +144,6 @@ linters-settings:
|
||||
# Whether to skip (*x).method() calls where x is a pointer receiver.
|
||||
skipRecvDeref: false
|
||||
|
||||
# gomnd:
|
||||
# # Values always ignored: `time.Date`,
|
||||
# # `strconv.FormatInt`, `strconv.FormatUint`, `strconv.FormatFloat`,
|
||||
# # `strconv.ParseInt`, `strconv.ParseUint`, `strconv.ParseFloat`.
|
||||
# ignored-functions:
|
||||
# - os.Chmod
|
||||
# - os.Mkdir
|
||||
# - os.MkdirAll
|
||||
# - os.OpenFile
|
||||
# - os.WriteFile
|
||||
# - prometheus.ExponentialBuckets
|
||||
# - prometheus.ExponentialBucketsRange
|
||||
# - prometheus.LinearBuckets
|
||||
|
||||
gomodguard:
|
||||
blocked:
|
||||
# List of blocked modules.
|
||||
@@ -205,6 +185,43 @@ linters-settings:
|
||||
- all
|
||||
- -ST1008 # handled by revive already.
|
||||
|
||||
sloglint:
|
||||
# Enforce not using global loggers.
|
||||
no-global: "all"
|
||||
# Enforce using methods that accept a context.
|
||||
context: "scope"
|
||||
|
||||
tagalign:
|
||||
align: true
|
||||
sort: true
|
||||
order:
|
||||
# go-flags items
|
||||
- command
|
||||
- alias
|
||||
- group
|
||||
- namespace
|
||||
- env-namespace
|
||||
- subcommands-optional
|
||||
- env
|
||||
- env-delim
|
||||
- short
|
||||
- long
|
||||
- no-flag
|
||||
- hidden
|
||||
- required
|
||||
- value-name
|
||||
- default
|
||||
- choice
|
||||
- description
|
||||
- long-description
|
||||
# everything else
|
||||
- json
|
||||
- yaml
|
||||
- yml
|
||||
- toml
|
||||
- validate
|
||||
strict: false
|
||||
|
||||
tenv:
|
||||
# The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures.
|
||||
# Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked.
|
||||
|
||||
18
vendor/github.com/lrstanley/girc/ctcp.go
generated
vendored
18
vendor/github.com/lrstanley/girc/ctcp.go
generated
vendored
@@ -155,7 +155,7 @@ func (c *CTCP) call(client *Client, event *CTCPEvent) {
|
||||
}
|
||||
|
||||
// Send a ERRMSG reply, if we know who sent it.
|
||||
if event.Source != nil && IsValidNick(event.Source.ID()) {
|
||||
if !event.Reply && event.Source != nil && IsValidNick(event.Source.ID()) {
|
||||
client.Cmd.SendCTCPReply(event.Source.ID(), CTCP_ERRMSG, "that is an unknown CTCP query")
|
||||
}
|
||||
return
|
||||
@@ -263,6 +263,10 @@ func handleCTCPPong(client *Client, ctcp CTCPEvent) {
|
||||
// as the os type (darwin, linux, windows, etc) and architecture type (x86,
|
||||
// arm, etc).
|
||||
func handleCTCPVersion(client *Client, ctcp CTCPEvent) {
|
||||
if ctcp.Reply {
|
||||
return
|
||||
}
|
||||
|
||||
if client.Config.Version != "" {
|
||||
client.Cmd.SendCTCPReply(ctcp.Source.ID(), CTCP_VERSION, client.Config.Version)
|
||||
return
|
||||
@@ -277,18 +281,30 @@ func handleCTCPVersion(client *Client, ctcp CTCPEvent) {
|
||||
|
||||
// handleCTCPSource replies with the public git location of this library.
|
||||
func handleCTCPSource(client *Client, ctcp CTCPEvent) {
|
||||
if ctcp.Reply {
|
||||
return
|
||||
}
|
||||
|
||||
client.Cmd.SendCTCPReply(ctcp.Source.ID(), CTCP_SOURCE, "https://github.com/lrstanley/girc")
|
||||
}
|
||||
|
||||
// handleCTCPTime replies with a RFC 1123 (Z) formatted version of Go's
|
||||
// local time.
|
||||
func handleCTCPTime(client *Client, ctcp CTCPEvent) {
|
||||
if ctcp.Reply {
|
||||
return
|
||||
}
|
||||
|
||||
client.Cmd.SendCTCPReply(ctcp.Source.ID(), CTCP_TIME, ":"+time.Now().Format(time.RFC1123Z))
|
||||
}
|
||||
|
||||
// handleCTCPFinger replies with the realname and idle time of the user. This
|
||||
// is obsoleted by improvements to the IRC protocol, however still supported.
|
||||
func handleCTCPFinger(client *Client, ctcp CTCPEvent) {
|
||||
if ctcp.Reply {
|
||||
return
|
||||
}
|
||||
|
||||
client.conn.mu.RLock()
|
||||
active := client.conn.lastActive
|
||||
client.conn.mu.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user