feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/921/head
Xinwei Xiong(cubxxw-openim) 2 years ago
parent e2629f43ab
commit e585c66104
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE

@ -52,22 +52,3 @@ jobs:
echo "REPO: $REPO" echo "REPO: $REPO"
git clone -b develop https://github.com/${OWNER}/${REPO}.git; cd ${REPO} git clone -b develop https://github.com/${OWNER}/${REPO}.git; cd ${REPO}
docker compose up -d docker compose up -d
# - name: deploy # Deployment
# run: |
# ssh work@182.92.xxx.xxx "
# # 【Attention】Log in with the 'work' account, manually create /home/work/imooc-lego directory
# # Then git clone https://username:password@github.com/imooc-lego/biz-editor-server.git -b dev (private repository, use GitHub username and password)
# # Remember to delete origin to avoid exposing GitHub password
# cd /home/work/imooc-lego/biz-editor-server;
# git remote add origin https://openimbot:${{secrets.WFP_PASSWORD}}@github.com/OpenIMSDK/open-im-server.git;
# git checkout dev;
# git pull origin dev; # Download the latest code again
# git remote remove origin; # Remove origin to avoid exposing GitHub password
# # Start docker
# docker-compose build editor-server; # Same as the service name in docker-compose.yml
# docker-compose up -d;
# "
# - name: delete ssh key # Delete ssh key
# run: rm -rf ~/.ssh/id_rsa

@ -26,13 +26,13 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.20' go-version: '1.21'
cache: false cache: false
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v3.7.0 uses: golangci/golangci-lint-action@v3.7.0
with: with:
# Require: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version # Require: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.53 version: v1.54
# Optional: working directory, useful for monorepos # Optional: working directory, useful for monorepos
# working-directory: server # working-directory: server

@ -176,7 +176,7 @@ linters-settings:
# put imports beginning with prefix after 3rd-party packages; # put imports beginning with prefix after 3rd-party packages;
# only support one prefix # only support one prefix
# if not set, use goimports.local-prefixes # if not set, use goimports.local-prefixes
prefix: github.com/OpenIMSDK/OpenKF prefix: github.com/OpenIMSDK/Open-IM-Server
gocognit: gocognit:
# minimal code complexity to report, 30 by default (but we recommend 10-20) # minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 30 min-complexity: 30
@ -333,10 +333,8 @@ linters-settings:
goimports: goimports:
# put imports beginning with prefix after 3rd-party packages; # put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes # it's a comma-separated list of prefixes
local-prefixes: github.com/OpenIMSDK/OpenKF local-prefixes: github.com/OpenIMSDK/Open-IM-Server
golint:
# minimal confidence for issues, default is 0.8
min-confidence: 0.9
gomnd: gomnd:
settings: settings:
mnd: mnd:
@ -442,12 +440,7 @@ linters-settings:
# packages-with-error-message: # packages-with-error-message:
# # specify an error message to output when a blacklisted package is used # # specify an error message to output when a blacklisted package is used
# - github.com/Sirupsen/logrus: "logging is allowed only by logutils.Log" # - github.com/Sirupsen/logrus: "logging is allowed only by logutils.Log"
ifshort:
# Maximum length of variable declaration measured in number of lines, after which linter won't suggest using short syntax.
# Has higher priority than max-decl-chars.
max-decl-lines: 1
# Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax.
max-decl-chars: 30
importas: importas:
# if set to `true`, force to use alias. # if set to `true`, force to use alias.
@ -722,7 +715,6 @@ linters:
- asciicheck - asciicheck
- bodyclose - bodyclose
- cyclop - cyclop
- deadcode
# - depguard # - depguard
- dogsled - dogsled
- dupl - dupl
@ -750,7 +742,6 @@ linters:
- gosec - gosec
- gosimple - gosimple
- govet - govet
- ifshort
- importas - importas
- ineffassign - ineffassign
- lll - lll
@ -770,19 +761,16 @@ linters:
- rowserrcheck - rowserrcheck
- sqlclosecheck - sqlclosecheck
- staticcheck - staticcheck
- structcheck
- stylecheck - stylecheck
- thelper - thelper
- tparallel - tparallel
- unconvert - unconvert
- unparam - unparam
- unused - unused
- varcheck
- wastedassign - wastedassign
- whitespace - whitespace
- bidichk - bidichk
- wastedassign - wastedassign
- golint
- execinquery - execinquery
- nosprintfhostport - nosprintfhostport
- grouper - grouper
@ -813,10 +801,6 @@ issues:
# Excluding configuration per-path, per-linter, per-text and per-source # Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules: exclude-rules:
- linters:
- golint
path: (internal/api/.*)\.go # exclude golint for internal/api/... files
- linters: - linters:
- revive - revive
path: (log/.*)\.go path: (log/.*)\.go
@ -856,9 +840,7 @@ issues:
- path: (pkg/app/.*)\.go - path: (pkg/app/.*)\.go
linters: linters:
- deadcode
- unused - unused
- varcheck
- forbidigo - forbidigo
# Exclude some staticcheck messages # Exclude some staticcheck messages

Loading…
Cancel
Save