fix: lint
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2023-08-29 11:32:45 +02:00
parent c1ccbe8186
commit 29317b980e
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
6 changed files with 25 additions and 14 deletions

View File

@ -97,3 +97,9 @@ issues:
- musttag - musttag
- path: pkg/models/task_collection.go - path: pkg/models/task_collection.go
text: 'append result not assigned to the same slice' text: 'append result not assigned to the same slice'
- text: 'string `label_id` has 3 occurrences, make it a constant'
linters:
- goconst
- text: 'string `labels` has 3 occurrences, make it a constant'
linters:
- goconst

View File

@ -1,5 +1,5 @@
// Vikunja is a to-do list application to facilitate your life. // Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2023 Vikunja and contributors. All rights reserved. // Copyright 2018-2021 Vikunja and contributors. All rights reserved.
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by // it under the terms of the GNU Affero General Public Licensee as published by

View File

@ -17,8 +17,9 @@
package migration package migration
import ( import (
"src.techknowlogick.com/xormigrate"
"time" "time"
"src.techknowlogick.com/xormigrate"
"xorm.io/xorm" "xorm.io/xorm"
) )

View File

@ -17,10 +17,11 @@
package models package models
import ( import (
"code.vikunja.io/api/pkg/config"
"encoding/json" "encoding/json"
"strconv" "strconv"
"code.vikunja.io/api/pkg/config"
"code.vikunja.io/api/pkg/db" "code.vikunja.io/api/pkg/db"
"code.vikunja.io/api/pkg/events" "code.vikunja.io/api/pkg/events"
"code.vikunja.io/api/pkg/log" "code.vikunja.io/api/pkg/log"

View File

@ -1,5 +1,5 @@
// Vikunja is a to-do list application to facilitate your life. // Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2023 Vikunja and contributors. All rights reserved. // Copyright 2018-2021 Vikunja and contributors. All rights reserved.
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by // it under the terms of the GNU Affero General Public Licensee as published by
@ -17,13 +17,14 @@
package models package models
import ( import (
"strconv"
"strings"
"code.vikunja.io/api/pkg/db" "code.vikunja.io/api/pkg/db"
"code.vikunja.io/api/pkg/log" "code.vikunja.io/api/pkg/log"
"code.vikunja.io/web" "code.vikunja.io/web"
"github.com/typesense/typesense-go/typesense/api" "github.com/typesense/typesense-go/typesense/api"
"github.com/typesense/typesense-go/typesense/api/pointer" "github.com/typesense/typesense-go/typesense/api/pointer"
"strconv"
"strings"
"xorm.io/builder" "xorm.io/builder"
"xorm.io/xorm" "xorm.io/xorm"
@ -73,6 +74,7 @@ func getOrderByDBStatement(opts *taskSearchOptions) (orderby string, err error)
return return
} }
//nolint:gocyclo
func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCount int64, err error) { func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCount int64, err error) {
orderby, err := getOrderByDBStatement(opts) orderby, err := getOrderByDBStatement(opts)
@ -261,15 +263,15 @@ func convertFilterValues(value interface{}) string {
return strings.Join(filter, ",") return strings.Join(filter, ",")
} }
switch value.(type) { switch v := value.(type) {
case string: case string:
return value.(string) return v
case int: case int:
return strconv.Itoa(value.(int)) return strconv.Itoa(v)
case int64: case int64:
return strconv.FormatInt(value.(int64), 10) return strconv.FormatInt(v, 10)
case bool: case bool:
if value.(bool) { if v {
return "true" return "true"
} }

View File

@ -1,5 +1,5 @@
// Vikunja is a to-do list application to facilitate your life. // Vikunja is a to-do list application to facilitate your life.
// Copyright 2018-2023 Vikunja and contributors. All rights reserved. // Copyright 2018-2021 Vikunja and contributors. All rights reserved.
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public Licensee as published by // it under the terms of the GNU Affero General Public Licensee as published by
@ -17,10 +17,11 @@
package models package models
import ( import (
"code.vikunja.io/api/pkg/cron"
"code.vikunja.io/api/pkg/log"
"fmt" "fmt"
"time" "time"
"code.vikunja.io/api/pkg/cron"
"code.vikunja.io/api/pkg/log"
"xorm.io/xorm" "xorm.io/xorm"
"code.vikunja.io/api/pkg/config" "code.vikunja.io/api/pkg/config"