feat: add rules for linting and some little fixes
This commit is contained in:
parent
9584c17c20
commit
c28bb6bb2d
@ -3,10 +3,16 @@ include:
|
|||||||
file: "/templates/docker/build-template.gitlab-ci.yml"
|
file: "/templates/docker/build-template.gitlab-ci.yml"
|
||||||
- project: "devops/pena-continuous-integration"
|
- project: "devops/pena-continuous-integration"
|
||||||
file: "/templates/docker/deploy-template.gitlab-ci.yml"
|
file: "/templates/docker/deploy-template.gitlab-ci.yml"
|
||||||
|
- project: "devops/pena-continuous-integration"
|
||||||
|
file: "/templates/docker/golint.gitlab-ci.yml"
|
||||||
stages:
|
stages:
|
||||||
|
- lint
|
||||||
- build
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
|
lint:
|
||||||
|
extends: .golint_template
|
||||||
|
|
||||||
build-app:
|
build-app:
|
||||||
extends: .build_template
|
extends: .build_template
|
||||||
|
|
||||||
|
10
Taskfile.dist.yml
Normal file
10
Taskfile.dist.yml
Normal file
@ -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
|
@ -10,6 +10,7 @@ import (
|
|||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
_ "penahub.gitlab.yandexcloud.net/devops/linters/golang.git/pkg/dummy"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
3
go.mod
3
go.mod
@ -1,6 +1,6 @@
|
|||||||
module codeword
|
module codeword
|
||||||
|
|
||||||
go 1.21
|
go 1.22.2
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/caarlos0/env/v8 v8.0.0
|
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/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
||||||
gopkg.in/tucnak/telebot.v2 v2.5.0 // indirect
|
gopkg.in/tucnak/telebot.v2 v2.5.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
|
penahub.gitlab.yandexcloud.net/devops/linters/golang.git v0.0.0-20240725131128-102f5d56f156 // indirect
|
||||||
)
|
)
|
||||||
|
2
go.sum
2
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-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 h1:CWb4UcuNXhd1KTNOmy2U0TJO4+Qxgxrj5cwkyFqbgrk=
|
||||||
penahub.gitlab.yandexcloud.net/backend/penahub_common v0.0.0-20240607202348-efe5f2bf3e8c/go.mod h1:+bPxq2wfW5S1gd+83vZYmHm33AE7nEBfznWS8AM1TKE=
|
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 h1:WlRVJnzU0sti+qBq/JTCgFPU0RoxIqGHu7hzDirxE2k=
|
||||||
penahub.gitlab.yandexcloud.net/external/trashlog.git v0.1.2-0.20240523172059-9bbe8a9faa31/go.mod h1:3ml0dAGT8U8RhpevKBfRgG6yKZum8EI2uJxAb2WCIy4=
|
penahub.gitlab.yandexcloud.net/external/trashlog.git v0.1.2-0.20240523172059-9bbe8a9faa31/go.mod h1:3ml0dAGT8U8RhpevKBfRgG6yKZum8EI2uJxAb2WCIy4=
|
||||||
|
@ -403,7 +403,6 @@ func TestActivatePromo(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("ActivatePromo Codeword - success", func(t *testing.T) {
|
t.Run("ActivatePromo Codeword - success", func(t *testing.T) {
|
||||||
req := &models.ActivateReq{
|
req := &models.ActivateReq{
|
||||||
UserID: "6597babdd1ba7e2dbd32d7e3",
|
|
||||||
Codeword: "test_codeword",
|
Codeword: "test_codeword",
|
||||||
}
|
}
|
||||||
activatedPromoCode, err := userRepo.ActivatePromo(ctx, req)
|
activatedPromoCode, err := userRepo.ActivatePromo(ctx, req)
|
||||||
@ -413,7 +412,6 @@ func TestActivatePromo(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("ActivatePromo FastLink - success", func(t *testing.T) {
|
t.Run("ActivatePromo FastLink - success", func(t *testing.T) {
|
||||||
req := &models.ActivateReq{
|
req := &models.ActivateReq{
|
||||||
UserID: "6597babdd1ba7e2dbd32d7e3",
|
|
||||||
FastLink: "test_xid",
|
FastLink: "test_xid",
|
||||||
}
|
}
|
||||||
activatedPromoCode, err := userRepo.ActivatePromo(ctx, req)
|
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) {
|
t.Run("ActivatePromo - promo code not found", func(t *testing.T) {
|
||||||
req := &models.ActivateReq{
|
req := &models.ActivateReq{
|
||||||
UserID: "6597babdd1ba7e2dbd32d7e3",
|
|
||||||
Codeword: "non_existing_codeword",
|
Codeword: "non_existing_codeword",
|
||||||
}
|
}
|
||||||
_, err := userRepo.ActivatePromo(ctx, req)
|
_, err := userRepo.ActivatePromo(ctx, req)
|
||||||
|
Loading…
Reference in New Issue
Block a user