mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-15 10:53:09 -06:00
Making linting happy
This commit is contained in:
parent
fcdb18d77f
commit
9966b5b68c
|
|
@ -76,7 +76,7 @@ linters-settings:
|
||||||
|
|
||||||
# path to a file containing a list of functions to exclude from checking
|
# path to a file containing a list of functions to exclude from checking
|
||||||
# see https://github.com/kisielk/errcheck#excluding-functions for details
|
# see https://github.com/kisielk/errcheck#excluding-functions for details
|
||||||
exclude: /path/to/file.txt
|
#exclude: /path/to/file.txt
|
||||||
govet:
|
govet:
|
||||||
# report about shadowed variables
|
# report about shadowed variables
|
||||||
check-shadowing: true
|
check-shadowing: true
|
||||||
|
|
@ -163,28 +163,28 @@ linters-settings:
|
||||||
#enabled-checks:
|
#enabled-checks:
|
||||||
|
|
||||||
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
|
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
|
||||||
disabled-checks:
|
#disabled-checks:
|
||||||
- regexpMust
|
|
||||||
|
|
||||||
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
|
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
|
||||||
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
|
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
|
||||||
enabled-tags:
|
#enabled-tags:
|
||||||
- performance
|
# - performance
|
||||||
|
|
||||||
settings: # settings passed to gocritic
|
settings: # settings passed to gocritic
|
||||||
captLocal: # must be valid enabled check name
|
captLocal: # must be valid enabled check name
|
||||||
paramsOnly: true
|
paramsOnly: true
|
||||||
rangeValCopy:
|
#rangeValCopy:
|
||||||
sizeThreshold: 32
|
# sizeThreshold: 32
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
- megacheck
|
- megacheck
|
||||||
- govet
|
|
||||||
enable-all: false
|
enable-all: false
|
||||||
disable:
|
disable:
|
||||||
- maligned
|
- maligned
|
||||||
- prealloc
|
- prealloc
|
||||||
|
- gosec
|
||||||
|
- scopelint
|
||||||
disable-all: false
|
disable-all: false
|
||||||
presets:
|
presets:
|
||||||
- bugs
|
- bugs
|
||||||
|
|
@ -248,7 +248,7 @@ issues:
|
||||||
new: false
|
new: false
|
||||||
|
|
||||||
# Show only new issues created after git revision `REV`
|
# Show only new issues created after git revision `REV`
|
||||||
new-from-rev: REV
|
#new-from-rev: REV
|
||||||
|
|
||||||
# Show only new issues created in git patch with set file path.
|
# Show only new issues created in git patch with set file path.
|
||||||
new-from-patch: path/to/patch/file
|
#new-from-patch: path/to/patch/file
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,8 @@ func parseEventIDParam(
|
||||||
) (eventID string, resErr *util.JSONResponse) {
|
) (eventID string, resErr *util.JSONResponse) {
|
||||||
URL, err := url.Parse(request.RequestURI())
|
URL, err := url.Parse(request.RequestURI())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
*resErr = util.ErrorResponse(err)
|
response := util.ErrorResponse(err)
|
||||||
|
resErr = &response
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"Vendor": true,
|
|
||||||
"Cyclo": 12,
|
|
||||||
"Deadline": "5m",
|
|
||||||
"Enable": [
|
|
||||||
"vetshadow",
|
|
||||||
"deadcode",
|
|
||||||
"gocyclo",
|
|
||||||
"ineffassign",
|
|
||||||
"misspell",
|
|
||||||
"errcheck",
|
|
||||||
"vet",
|
|
||||||
"gofmt",
|
|
||||||
"goconst"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
20
linter.json
20
linter.json
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"Vendor": true,
|
|
||||||
"Cyclo": 12,
|
|
||||||
"Deadline": "5m",
|
|
||||||
"Enable": [
|
|
||||||
"vetshadow",
|
|
||||||
"deadcode",
|
|
||||||
"gocyclo",
|
|
||||||
"golint",
|
|
||||||
"varcheck",
|
|
||||||
"structcheck",
|
|
||||||
"ineffassign",
|
|
||||||
"misspell",
|
|
||||||
"unparam",
|
|
||||||
"errcheck",
|
|
||||||
"vet",
|
|
||||||
"gofmt",
|
|
||||||
"goconst"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
@ -20,9 +20,11 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"image"
|
"image"
|
||||||
"image/draw"
|
"image/draw"
|
||||||
|
|
||||||
// Imported for gif codec
|
// Imported for gif codec
|
||||||
_ "image/gif"
|
_ "image/gif"
|
||||||
"image/jpeg"
|
"image/jpeg"
|
||||||
|
|
||||||
// Imported for png codec
|
// Imported for png codec
|
||||||
_ "image/png"
|
_ "image/png"
|
||||||
"os"
|
"os"
|
||||||
|
|
@ -258,9 +260,6 @@ func adjustSize(dst types.Path, img image.Image, w, h int, crop bool, logger *lo
|
||||||
out = target
|
out = target
|
||||||
} else {
|
} else {
|
||||||
out = resize.Thumbnail(uint(w), uint(h), img, resize.Lanczos3)
|
out = resize.Thumbnail(uint(w), uint(h), img, resize.Lanczos3)
|
||||||
if err != nil {
|
|
||||||
return -1, -1, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = writeFile(out, string(dst)); err != nil {
|
if err = writeFile(out, string(dst)); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -29,4 +29,4 @@ echo "Looking for lint..."
|
||||||
golangci-lint run $args
|
golangci-lint run $args
|
||||||
|
|
||||||
echo "Checking spelling..."
|
echo "Checking spelling..."
|
||||||
golangci-lint -E "misspell" ./*.md
|
misspell -error src *.md
|
||||||
|
|
|
||||||
|
|
@ -134,10 +134,6 @@ func (s *OutputRoomEventConsumer) onNewRoomEvent(
|
||||||
msg.RemovesStateEventIDs,
|
msg.RemovesStateEventIDs,
|
||||||
msg.TransactionID,
|
msg.TransactionID,
|
||||||
)
|
)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// panic rather than continue with an inconsistent database
|
// panic rather than continue with an inconsistent database
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
|
|
|
||||||
2
typingserver/cache/cache_test.go
vendored
2
typingserver/cache/cache_test.go
vendored
|
|
@ -38,7 +38,7 @@ func TestTypingCache(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func testAddTypingUser(t *testing.T, tCache *TypingCache) {
|
func testAddTypingUser(t *testing.T, tCache *TypingCache) { // nolint: unparam
|
||||||
present := time.Now()
|
present := time.Now()
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
userID string
|
userID string
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue