-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: 源文雨 <[email protected]>
- Loading branch information
Showing
33 changed files
with
303 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: PullLint | ||
on: [ pull_request ] | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@master | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@master | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@master | ||
with: | ||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
version: latest | ||
|
||
# Optional: working directory, useful for monorepos | ||
# working-directory: somedir | ||
|
||
# Optional: golangci-lint command line arguments. | ||
# args: --issues-exit-code=0 | ||
|
||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
# only-new-issues: true | ||
|
||
# Optional: if set to true then the action don't cache or restore ~/go/pkg. | ||
# skip-pkg-cache: true | ||
|
||
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build. | ||
# skip-build-cache: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: PushLint | ||
on: [ push ] | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@master | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@master | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@master | ||
with: | ||
version: latest | ||
|
||
- name: Commit back | ||
if: ${{ !github.head_ref }} | ||
continue-on-error: true | ||
run: | | ||
git config --local user.name 'github-actions[bot]' | ||
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
git add --all | ||
git commit -m "🎨 改进代码样式" | ||
- name: Create Pull Request | ||
if: ${{ !github.head_ref }} | ||
continue-on-error: true | ||
uses: peter-evans/create-pull-request@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
linters-settings: | ||
errcheck: | ||
ignore: fmt:.* | ||
ignoretests: true | ||
|
||
goimports: | ||
local-prefixes: github.com/FloatTech/AnimeAPI | ||
|
||
forbidigo: | ||
# Forbid the following identifiers | ||
forbid: | ||
- ^fmt\.Errorf$ # consider errors.Errorf in github.com/pkg/errors | ||
|
||
linters: | ||
# please, do not use `enable-all`: it's deprecated and will be removed soon. | ||
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint | ||
disable-all: true | ||
fast: false | ||
enable: | ||
- bodyclose | ||
- depguard | ||
- dogsled | ||
- errcheck | ||
- exportloopref | ||
- exhaustive | ||
#- funlen | ||
#- goconst | ||
- gocritic | ||
#- gocyclo | ||
- gofmt | ||
- goimports | ||
- goprintffuncname | ||
#- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
#- misspell | ||
- nolintlint | ||
- rowserrcheck | ||
- staticcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- whitespace | ||
- prealloc | ||
- predeclared | ||
- asciicheck | ||
- revive | ||
- forbidigo | ||
- makezero | ||
|
||
run: | ||
# default concurrency is a available CPU number. | ||
# concurrency: 4 # explicitly omit this value to fully utilize available resources. | ||
deadline: 5m | ||
issues-exit-code: 1 | ||
tests: false | ||
skip-dirs: | ||
- order | ||
go: '1.19' | ||
|
||
# output configuration options | ||
output: | ||
format: "colored-line-number" | ||
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 | ||
exclude-use-default: false | ||
exclude: | ||
- "Error return value of .((os.)?std(out|err)..*|.*Close|.*Seek|.*Flush|os.Remove(All)?|.*print(f|ln)?|os.(Un)?Setenv). is not check" | ||
- 'identifier ".*" contain non-ASCII character: U\+.*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.