mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Build: use golangci-lint as a make command (#17739)
* Build: use golangci-lint as a make command * Since gometalinter was deprecated in favor of golangci-lint so it was replaced by it. Responsibilities held by the gometalinter was moved to golangci-lint * There was some changes in implementation (that was also mentioned in the code comment) between the tools, which uncovered couple errors in the code. Those issues were either solved or disabled by the inline comments * Introduce the golangci-lint config, to make their configuration more manageable * Build: replace backend-lint.sh script with make
This commit is contained in:
@@ -10,6 +10,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"gopkg.in/macaron.v1"
|
||||
|
||||
"github.com/grafana/grafana/pkg/api/dtos"
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
"github.com/grafana/grafana/pkg/infra/remotecache"
|
||||
@@ -18,11 +21,11 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/login"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
const errorTemplate = "error-template"
|
||||
|
||||
func mockGetTime() {
|
||||
var timeSeed int64
|
||||
getTime = func() time.Time {
|
||||
@@ -37,7 +40,7 @@ func resetGetTime() {
|
||||
}
|
||||
|
||||
func TestMiddleWareSecurityHeaders(t *testing.T) {
|
||||
setting.ERR_TEMPLATE_NAME = "error-template"
|
||||
setting.ERR_TEMPLATE_NAME = errorTemplate
|
||||
|
||||
Convey("Given the grafana middleware", t, func() {
|
||||
|
||||
@@ -70,7 +73,7 @@ func TestMiddleWareSecurityHeaders(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMiddlewareContext(t *testing.T) {
|
||||
setting.ERR_TEMPLATE_NAME = "error-template"
|
||||
setting.ERR_TEMPLATE_NAME = errorTemplate
|
||||
|
||||
Convey("Given the grafana middleware", t, func() {
|
||||
middlewareScenario(t, "middleware should add context to injector", func(sc *scenarioContext) {
|
||||
|
||||
Reference in New Issue
Block a user