diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aaede0b..c37da4d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,10 +3,16 @@ include: file: "/templates/docker/build-template.gitlab-ci.yml" - project: "devops/pena-continuous-integration" file: "/templates/docker/deploy-template.gitlab-ci.yml" + - project: "devops/pena-continuous-integration" + file: "/templates/docker/golint.gitlab-ci.yml" stages: + - lint - build - deploy +lint: + extends: .golint_template + build-app: extends: .build_template diff --git a/Taskfile.dist.yml b/Taskfile.dist.yml new file mode 100644 index 0000000..c96d07c --- /dev/null +++ b/Taskfile.dist.yml @@ -0,0 +1,10 @@ +version: "3" + +tasks: + update-linter: + cmds: + - go get -u penahub.gitlab.yandexcloud.net/devops/linters/golang.git + lint: + cmds: + - task: update-linter + - cmd: golangci-lint run -v -c $(go list -f '{{"{{"}}.Dir{{"}}"}}' -m penahub.gitlab.yandexcloud.net/devops/linters/golang.git)/.golangci.yml diff --git a/cmd/codeword/main.go b/cmd/codeword/main.go index a03d31a..01aa102 100644 --- a/cmd/codeword/main.go +++ b/cmd/codeword/main.go @@ -10,6 +10,7 @@ import ( "os/signal" "syscall" "time" + _ "penahub.gitlab.yandexcloud.net/devops/linters/golang.git/pkg/dummy" ) var ( diff --git a/go.mod b/go.mod index d6ce808..fde369a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module codeword -go 1.21 +go 1.22.2 require ( github.com/caarlos0/env/v8 v8.0.0 @@ -63,4 +63,5 @@ require ( gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect gopkg.in/tucnak/telebot.v2 v2.5.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + penahub.gitlab.yandexcloud.net/devops/linters/golang.git v0.0.0-20240725131128-102f5d56f156 // indirect ) diff --git a/go.sum b/go.sum index 7acf0e0..9d70600 100644 --- a/go.sum +++ b/go.sum @@ -293,5 +293,7 @@ penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240607142502-8257 penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240607142502-8257e6c4aa5a/go.mod h1:+bPxq2wfW5S1gd+83vZYmHm33AE7nEBfznWS8AM1TKE= penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240607202348-efe5f2bf3e8c h1:CWb4UcuNXhd1KTNOmy2U0TJO4+Qxgxrj5cwkyFqbgrk= penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240607202348-efe5f2bf3e8c/go.mod h1:+bPxq2wfW5S1gd+83vZYmHm33AE7nEBfznWS8AM1TKE= +penahub.gitlab.yandexcloud.net/devops/linters/golang.git v0.0.0-20240725131128-102f5d56f156 h1:IpItA0b6uvawjNk3KzI5X92Z7Iwn1FX7s2TfcJ8tRus= +penahub.gitlab.yandexcloud.net/devops/linters/golang.git v0.0.0-20240725131128-102f5d56f156/go.mod h1:LIcPclsOvgAKGuuMYXHDXVMx99WoGWHdmcc4Bgoftyk= penahub.gitlab.yandexcloud.net/external/trashlog.git v0.1.2-0.20240523172059-9bbe8a9faa31 h1:WlRVJnzU0sti+qBq/JTCgFPU0RoxIqGHu7hzDirxE2k= penahub.gitlab.yandexcloud.net/external/trashlog.git v0.1.2-0.20240523172059-9bbe8a9faa31/go.mod h1:3ml0dAGT8U8RhpevKBfRgG6yKZum8EI2uJxAb2WCIy4= diff --git a/tests/repository_test/repository_test.go b/tests/repository_test/repository_test.go index 724a137..ef364d7 100644 --- a/tests/repository_test/repository_test.go +++ b/tests/repository_test/repository_test.go @@ -403,7 +403,6 @@ func TestActivatePromo(t *testing.T) { t.Run("ActivatePromo Codeword - success", func(t *testing.T) { req := &models.ActivateReq{ - UserID: "6597babdd1ba7e2dbd32d7e3", Codeword: "test_codeword", } activatedPromoCode, err := userRepo.ActivatePromo(ctx, req) @@ -413,7 +412,6 @@ func TestActivatePromo(t *testing.T) { t.Run("ActivatePromo FastLink - success", func(t *testing.T) { req := &models.ActivateReq{ - UserID: "6597babdd1ba7e2dbd32d7e3", FastLink: "test_xid", } activatedPromoCode, err := userRepo.ActivatePromo(ctx, req) @@ -423,7 +421,6 @@ func TestActivatePromo(t *testing.T) { t.Run("ActivatePromo - promo code not found", func(t *testing.T) { req := &models.ActivateReq{ - UserID: "6597babdd1ba7e2dbd32d7e3", Codeword: "non_existing_codeword", } _, err := userRepo.ActivatePromo(ctx, req)