MM-25007: Add staticcheck (#14522)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
21af1f49f1
Коммит
bb172aea71
@@ -22,6 +22,7 @@ linters:
|
|||||||
- ineffassign
|
- ineffassign
|
||||||
- scopelint
|
- scopelint
|
||||||
- structcheck
|
- structcheck
|
||||||
|
- staticcheck
|
||||||
- unconvert
|
- unconvert
|
||||||
- unused
|
- unused
|
||||||
- varcheck
|
- varcheck
|
||||||
@@ -41,6 +42,10 @@ issues:
|
|||||||
# ignore warnings from table tests. https://github.com/kyoh86/scopelint/issues/4
|
# ignore warnings from table tests. https://github.com/kyoh86/scopelint/issues/4
|
||||||
path: ".*_test.go|store/storetest"
|
path: ".*_test.go|store/storetest"
|
||||||
|
|
||||||
|
- linters:
|
||||||
|
- staticcheck
|
||||||
|
path: ".*_test.go|store/storetest"
|
||||||
|
|
||||||
- linters:
|
- linters:
|
||||||
# ignore golint error for a lot of packages for now
|
# ignore golint error for a lot of packages for now
|
||||||
- golint
|
- golint
|
||||||
|
|||||||
@@ -136,7 +136,6 @@ func (s *Server) configureAudit(adt *audit.Audit) {
|
|||||||
filter := adt.MakeFilter(RestLevel, RestContentLevel, RestPermsLevel, CLILevel)
|
filter := adt.MakeFilter(RestLevel, RestContentLevel, RestPermsLevel, CLILevel)
|
||||||
formatter := adt.MakeJSONFormatter()
|
formatter := adt.MakeJSONFormatter()
|
||||||
formatter.DisableTimestamp = false
|
formatter.DisableTimestamp = false
|
||||||
formatter.Indent = "\n"
|
|
||||||
target, err := audit.NewFileTarget(filter, formatter, opts, maxQueueSize)
|
target, err := audit.NewFileTarget(filter, formatter, opts, maxQueueSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
mlog.Error("cannot configure File audit target", mlog.Err(err))
|
mlog.Error("cannot configure File audit target", mlog.Err(err))
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ func resizeEmoji(img image.Image, width int, height int) image.Image {
|
|||||||
func imageToPaletted(img image.Image) *image.Paletted {
|
func imageToPaletted(img image.Image) *image.Paletted {
|
||||||
b := img.Bounds()
|
b := img.Bounds()
|
||||||
pm := image.NewPaletted(b, palette.Plan9)
|
pm := image.NewPaletted(b, palette.Plan9)
|
||||||
draw.FloydSteinberg.Draw(pm, b, img, image.ZP)
|
draw.FloydSteinberg.Draw(pm, b, img, image.Point{})
|
||||||
return pm
|
return pm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -330,8 +330,7 @@ func (a *App) MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Copy and save the updated post
|
// Copy and save the updated post
|
||||||
newPost := &model.Post{}
|
newPost := post.Clone()
|
||||||
newPost = post.Clone()
|
|
||||||
|
|
||||||
newPost.Filenames = []string{}
|
newPost.Filenames = []string{}
|
||||||
newPost.FileIds = fileIds
|
newPost.FileIds = fileIds
|
||||||
|
|||||||
@@ -709,7 +709,7 @@ func CreateProfileImage(username string, userId string, initialFont string) ([]b
|
|||||||
color := colors[int64(seed)%int64(len(colors))]
|
color := colors[int64(seed)%int64(len(colors))]
|
||||||
dstImg := image.NewRGBA(image.Rect(0, 0, IMAGE_PROFILE_PIXEL_DIMENSION, IMAGE_PROFILE_PIXEL_DIMENSION))
|
dstImg := image.NewRGBA(image.Rect(0, 0, IMAGE_PROFILE_PIXEL_DIMENSION, IMAGE_PROFILE_PIXEL_DIMENSION))
|
||||||
srcImg := image.White
|
srcImg := image.White
|
||||||
draw.Draw(dstImg, dstImg.Bounds(), &image.Uniform{color}, image.ZP, draw.Src)
|
draw.Draw(dstImg, dstImg.Bounds(), &image.Uniform{color}, image.Point{}, draw.Src)
|
||||||
size := float64(IMAGE_PROFILE_PIXEL_DIMENSION / 2)
|
size := float64(IMAGE_PROFILE_PIXEL_DIMENSION / 2)
|
||||||
|
|
||||||
c := freetype.NewContext()
|
c := freetype.NewContext()
|
||||||
|
|||||||
@@ -3886,6 +3886,10 @@
|
|||||||
"id": "ent.compliance.csv.metadata.json.marshalling.appError",
|
"id": "ent.compliance.csv.metadata.json.marshalling.appError",
|
||||||
"translation": "Unable to convert metadata to json."
|
"translation": "Unable to convert metadata to json."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "ent.compliance.csv.metadata.json.zipfile.appError",
|
||||||
|
"translation": "Unable to create the zip file"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "ent.compliance.csv.post.export.appError",
|
"id": "ent.compliance.csv.post.export.appError",
|
||||||
"translation": "Unable to export a post."
|
"translation": "Unable to export a post."
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user