mirror of https://github.com/gogs/gogs.git
ci: fix up lint issues
parent
88a13fa378
commit
300519d1ca
|
@ -30,14 +30,13 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Run golangci-lint
|
||||
uses: golangci/golangci-lint-action@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
version: latest
|
||||
args: --timeout=30m
|
||||
go-version: 1.23.x
|
||||
- name: Install Task
|
||||
uses: arduino/setup-task@v1
|
||||
uses: arduino/setup-task@v2
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Check Go module tidiness and generated files
|
||||
|
@ -52,6 +51,11 @@ jobs:
|
|||
echo "Run 'go mod tidy' or 'task generate' commit them"
|
||||
exit 1
|
||||
fi
|
||||
- name: Run golangci-lint
|
||||
uses: golangci/golangci-lint-action@v4
|
||||
with:
|
||||
version: latest
|
||||
args: --timeout=30m
|
||||
|
||||
test:
|
||||
name: Test
|
||||
|
|
|
@ -6,6 +6,11 @@ linters-settings:
|
|||
]
|
||||
nakedret:
|
||||
max-func-lines: 0 # Disallow any unnamed return statement
|
||||
govet:
|
||||
disable:
|
||||
# printf: non-constant format string in call to fmt.Errorf (govet)
|
||||
# showing up since golangci-lint version 1.60.1
|
||||
- printf
|
||||
|
||||
linters:
|
||||
enable:
|
||||
|
|
4
gen.go
4
gen.go
|
@ -4,5 +4,5 @@
|
|||
|
||||
package main
|
||||
|
||||
//go:generate go install golang.org/x/tools/cmd/goimports@v0.1.10
|
||||
//go:generate go run github.com/derision-test/go-mockgen/cmd/go-mockgen@v1.3.3
|
||||
//go:generate go install golang.org/x/tools/cmd/goimports@v0.17.0
|
||||
//go:generate go run github.com/derision-test/go-mockgen/v2/cmd/go-mockgen@v2.0.1
|
||||
|
|
|
@ -361,7 +361,7 @@ func (issue *Issue) ClearLabels(doer *User) (err error) {
|
|||
err = issue.PullRequest.LoadIssue()
|
||||
if err != nil {
|
||||
log.Error("LoadIssue: %v", err)
|
||||
return
|
||||
return err
|
||||
}
|
||||
err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
|
||||
Action: api.HOOK_ISSUE_LABEL_CLEARED,
|
||||
|
|
|
@ -357,7 +357,7 @@ func ChangeMilestoneAssign(doer *User, issue *Issue, oldMilestoneID int64) (err
|
|||
err = issue.PullRequest.LoadIssue()
|
||||
if err != nil {
|
||||
log.Error("LoadIssue: %v", err)
|
||||
return
|
||||
return err
|
||||
}
|
||||
err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
|
||||
Action: hookAction,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by go-mockgen 1.3.3; DO NOT EDIT.
|
||||
// Code generated by go-mockgen 1.3.7; DO NOT EDIT.
|
||||
//
|
||||
// This file was generated by running `go-mockgen` at the root of this repository.
|
||||
// To add additional mocks to this or another package, add a new entry to the
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by go-mockgen 1.3.3; DO NOT EDIT.
|
||||
// Code generated by go-mockgen 1.3.7; DO NOT EDIT.
|
||||
//
|
||||
// This file was generated by running `go-mockgen` at the root of this repository.
|
||||
// To add additional mocks to this or another package, add a new entry to the
|
||||
|
|
Loading…
Reference in New Issue