From c43cb5d0f56d83ac94ef63b90172037d9efcd88c Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Wed, 17 Mar 2021 22:37:43 +0800 Subject: [PATCH] ci: auto fix --- .github/workflows/ci.yml | 10 ---------- .github/workflows/golint.yml | 24 ++++++++++++++++++++++++ .golangci.yml | 4 ++++ coolq/cqcode.go | 14 ++++++-------- 4 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/golint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53c0d85..a5fc0bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,13 +48,3 @@ jobs: with: name: ${{ matrix.goos }}_${{ matrix.goarch }} path: output/ - - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: latest diff --git a/.github/workflows/golint.yml b/.github/workflows/golint.yml new file mode 100644 index 0000000..d7e6da6 --- /dev/null +++ b/.github/workflows/golint.yml @@ -0,0 +1,24 @@ +name: CI + +on: [push, pull_request] + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: latest + + - name: Commit back + continue-on-error: true + run: | + git config --local user.name 'Github Actions' + git config --local user.email 'github-actions@users.noreply.github.com' + git add --all + git commit -m "ci(chore): Fix stylings" + git push diff --git a/.golangci.yml b/.golangci.yml index 5ca56e4..0754b49 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -86,3 +86,7 @@ output: print-issued-lines: true print-linter-name: true uniq-by-line: true + +issues: + # Fix found issues (if it's supported by the linter) + fix: true diff --git a/coolq/cqcode.go b/coolq/cqcode.go index 0b6f6a8..cd7735b 100644 --- a/coolq/cqcode.go +++ b/coolq/cqcode.go @@ -9,6 +9,12 @@ import ( xml2 "encoding/xml" "errors" "fmt" + "github.com/Mrs4s/MiraiGo/binary" + "github.com/Mrs4s/MiraiGo/message" + "github.com/Mrs4s/MiraiGo/utils" + "github.com/Mrs4s/go-cqhttp/global" + log "github.com/sirupsen/logrus" + "github.com/tidwall/gjson" "io" "io/ioutil" "math/rand" @@ -21,14 +27,6 @@ import ( "strings" "time" "unsafe" - - "github.com/Mrs4s/go-cqhttp/global" - - "github.com/Mrs4s/MiraiGo/binary" - "github.com/Mrs4s/MiraiGo/message" - "github.com/Mrs4s/MiraiGo/utils" - log "github.com/sirupsen/logrus" - "github.com/tidwall/gjson" ) /*