From 8a87ba62b2dc7c9028b651527da413b396814c56 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Tue, 25 Jul 2023 12:29:01 +0800 Subject: [PATCH] feat: add test format Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- .github/workflows/auto-gh-pr.yml | 2 +- .github/workflows/link-pr.yml | 3 --- config/config.yaml | 18 +++++++++--------- scripts/make-rules/golang.mk | 6 +++--- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/auto-gh-pr.yml b/.github/workflows/auto-gh-pr.yml index efa77ee29..a7e8ff5d4 100644 --- a/.github/workflows/auto-gh-pr.yml +++ b/.github/workflows/auto-gh-pr.yml @@ -14,7 +14,7 @@ env: jobs: create-pr: runs-on: ubuntu-latest - if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' + if: github.event.pull_request.base.ref == 'main' steps: - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/link-pr.yml b/.github/workflows/link-pr.yml index c6da4cb5f..a3e0ee2de 100644 --- a/.github/workflows/link-pr.yml +++ b/.github/workflows/link-pr.yml @@ -4,9 +4,6 @@ name: Github Rebot for Link check error on: schedule: - cron: '30 12 * * 1' - push: - branches: - - main jobs: linkChecker: diff --git a/config/config.yaml b/config/config.yaml index 10d43bd3e..1c01031dc 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -24,8 +24,8 @@ zookeeper: mysql: address: [ 127.0.0.1:13306 ] #目前仅支持单机 - username: root - password: openIM123 + username: root #用户名 + password: openIM123 #密码 database: openIM_v3 #不建议修改 maxOpenConn: 1000 #最大连接数 maxIdleConn: 100 #最大空闲连接数 @@ -37,14 +37,14 @@ mongo: uri: #不为空则直接使用该值 address: [ 127.0.0.1:37017 ] #单机时为mongo地址,使用分片集群时,为mongos地址 database: openIM_v3 #mongo db 默认即可 - username: root - password: openIM123 + username: root #用户名 + password: openIM123 #密码 maxPoolSize: 100 redis: address: [ 127.0.0.1:16379 ] # username: #only redis version 6.0+ need username - password: openIM123 + password: openIM123 #密码 kafka: username: #用户名 @@ -77,9 +77,9 @@ object: apiURL: "http://127.0.0.1:10002/object/" #地址需要app能访问到 minio: bucket: "openim" #不建议修改 - endpoint: http://127.0.0.1:10005 #地址需要app能够访问 - accessKeyID: root - secretAccessKey: openIM123 + endpoint: "http://127.0.0.1:10005" #minio对外服务的ip和端口,app要能访问此ip和端口 + accessKeyID: "root" #ID + secretAccessKey: "openIM123" #秘钥 sessionToken: "" #token cos: #tencent cos bucketURL: "https://temp-1252357374.cos.ap-chengdu.myqcloud.com" @@ -167,7 +167,7 @@ retainChatRecords: 365 #mongo保存离线消息 chatRecordsClearTime: "0 2 * * 3" #每周三凌晨2点清理mongo中的过期(超过retainChatRecords时间)消息,这个删除是为了清理满足上个配置retainChatRecords的过期消息,不会发送通知,仅仅作为清理磁盘使用 msgDestructTime: "0 2 * * *" #消息自动删除时间,每天凌晨2点删除过期消息,这个删除是为了删除保留时间超过超过会话字段msg_destruct_time(秒)的消息。 -secret: openIM123 +secret: tuoyun #秘钥,获取token时校验 tokenPolicy: expire: 90 #过期时间(天) diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk index cf07f0cda..282649d7e 100644 --- a/scripts/make-rules/golang.mk +++ b/scripts/make-rules/golang.mk @@ -173,9 +173,9 @@ go.test.cover: go.test.junit-report .PHONY: go.format go.format: tools.verify.golines tools.verify.goimports @echo "===========> Formating codes" - @$(FIND) -type f -name '*.go' | $(XARGS) gofmt -s -w - @$(FIND) -type f -name '*.go' | $(XARGS) $(TOOLS_DIR)/goimports -w -local $(ROOT_PACKAGE) - @$(FIND) -type f -name '*.go' | $(XARGS) $(TOOLS_DIR)/golines -w --max-len=200 --reformat-tags --shorten-comments --ignore-generated . + @$(FIND) -type f -name '*.go' -not -name '*pb*' | $(XARGS) gofmt -s -w + @$(FIND) -type f -name '*.go' -not -name '*pb*' | $(XARGS) $(TOOLS_DIR)/goimports -w -local $(ROOT_PACKAGE) + @$(FIND) -type f -name '*.go' -not -name '*pb*' | $(XARGS) $(TOOLS_DIR)/golines -w --max-len=200 --reformat-tags --shorten-comments --ignore-generated . @$(GO) mod edit -fmt ## imports: task to automatically handle import packages in Go files using goimports tool