mirror of
https://codeberg.org/crowci/crow.git
synced 2025-08-12 06:02:53 +03:00
Enable golangci linter stylecheck (#3167)
This PR only fixes error string formatting, log message strings are still mixed upper/lowercase (see https://github.com/woodpecker-ci/woodpecker/pull/3161#issuecomment-1885140649) and I'm not aware of a linter to enforce it.
This commit is contained in:
@@ -33,7 +33,6 @@ import (
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/forge"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/forge/common"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/forge/types"
|
||||
forge_types "go.woodpecker-ci.org/woodpecker/v2/server/forge/types"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/model"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/store"
|
||||
@@ -132,7 +131,7 @@ func (c *client) Login(ctx context.Context, res http.ResponseWriter, req *http.R
|
||||
}
|
||||
email := matchingEmail(emails, c.API)
|
||||
if email == nil {
|
||||
return nil, fmt.Errorf("No verified Email address for GitHub account")
|
||||
return nil, fmt.Errorf("no verified Email address for GitHub account")
|
||||
}
|
||||
|
||||
return &model.User{
|
||||
@@ -230,7 +229,7 @@ func (c *client) File(ctx context.Context, u *model.User, r *model.Repo, b *mode
|
||||
opts.Ref = b.Commit
|
||||
content, _, resp, err := client.Repositories.GetContents(ctx, r.Owner, r.Name, f, opts)
|
||||
if resp != nil && resp.StatusCode == http.StatusNotFound {
|
||||
return nil, errors.Join(err, &types.ErrConfigNotFound{Configs: []string{f}})
|
||||
return nil, errors.Join(err, &forge_types.ErrConfigNotFound{Configs: []string{f}})
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -249,7 +248,7 @@ func (c *client) Dir(ctx context.Context, u *model.User, r *model.Repo, b *model
|
||||
opts.Ref = b.Commit
|
||||
_, data, resp, err := client.Repositories.GetContents(ctx, r.Owner, r.Name, f, opts)
|
||||
if resp != nil && resp.StatusCode == http.StatusNotFound {
|
||||
return nil, errors.Join(err, &types.ErrConfigNotFound{Configs: []string{f}})
|
||||
return nil, errors.Join(err, &forge_types.ErrConfigNotFound{Configs: []string{f}})
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -262,7 +261,7 @@ func (c *client) Dir(ctx context.Context, u *model.User, r *model.Repo, b *model
|
||||
go func(path string) {
|
||||
content, err := c.File(ctx, u, r, b, path)
|
||||
if err != nil {
|
||||
if errors.Is(err, &types.ErrConfigNotFound{}) {
|
||||
if errors.Is(err, &forge_types.ErrConfigNotFound{}) {
|
||||
err = fmt.Errorf("git tree reported existence of file but we got: %s", err.Error())
|
||||
}
|
||||
errc <- err
|
||||
|
Reference in New Issue
Block a user