mirror of
https://github.com/gogs/gogs.git
synced 2025-05-31 11:42:13 +00:00
ci: fix up lint issues
This commit is contained in:
parent
88a13fa378
commit
300519d1ca
16
.github/workflows/go.yml
vendored
16
.github/workflows/go.yml
vendored
@ -30,14 +30,13 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
- name: Run golangci-lint
|
- name: Install Go
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
version: latest
|
go-version: 1.23.x
|
||||||
args: --timeout=30m
|
|
||||||
- name: Install Task
|
- name: Install Task
|
||||||
uses: arduino/setup-task@v1
|
uses: arduino/setup-task@v2
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Check Go module tidiness and generated files
|
- name: Check Go module tidiness and generated files
|
||||||
@ -52,6 +51,11 @@ jobs:
|
|||||||
echo "Run 'go mod tidy' or 'task generate' commit them"
|
echo "Run 'go mod tidy' or 'task generate' commit them"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
- name: Run golangci-lint
|
||||||
|
uses: golangci/golangci-lint-action@v4
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
args: --timeout=30m
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
|
@ -6,6 +6,11 @@ linters-settings:
|
|||||||
]
|
]
|
||||||
nakedret:
|
nakedret:
|
||||||
max-func-lines: 0 # Disallow any unnamed return statement
|
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:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
|
4
gen.go
4
gen.go
@ -4,5 +4,5 @@
|
|||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
//go:generate go install golang.org/x/tools/cmd/goimports@v0.1.10
|
//go:generate go install golang.org/x/tools/cmd/goimports@v0.17.0
|
||||||
//go:generate go run github.com/derision-test/go-mockgen/cmd/go-mockgen@v1.3.3
|
//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()
|
err = issue.PullRequest.LoadIssue()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("LoadIssue: %v", err)
|
log.Error("LoadIssue: %v", err)
|
||||||
return
|
return err
|
||||||
}
|
}
|
||||||
err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
|
err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
|
||||||
Action: api.HOOK_ISSUE_LABEL_CLEARED,
|
Action: api.HOOK_ISSUE_LABEL_CLEARED,
|
||||||
|
@ -357,7 +357,7 @@ func ChangeMilestoneAssign(doer *User, issue *Issue, oldMilestoneID int64) (err
|
|||||||
err = issue.PullRequest.LoadIssue()
|
err = issue.PullRequest.LoadIssue()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("LoadIssue: %v", err)
|
log.Error("LoadIssue: %v", err)
|
||||||
return
|
return err
|
||||||
}
|
}
|
||||||
err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
|
err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
|
||||||
Action: hookAction,
|
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.
|
// 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
|
// 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.
|
// 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
|
// To add additional mocks to this or another package, add a new entry to the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user