mirror of
https://codeberg.org/crowci/crow.git
synced 2025-08-12 06:02:53 +03:00
Add godot linter to harmonitze toplevel comments (#3650)
This commit is contained in:
@@ -84,12 +84,12 @@ type client struct {
|
||||
OnlyPublic bool
|
||||
}
|
||||
|
||||
// Name returns the string name of this driver
|
||||
// Name returns the string name of this driver.
|
||||
func (c *client) Name() string {
|
||||
return "github"
|
||||
}
|
||||
|
||||
// URL returns the root url of a configured forge
|
||||
// URL returns the root url of a configured forge.
|
||||
func (c *client) URL() string {
|
||||
return c.url
|
||||
}
|
||||
@@ -390,7 +390,7 @@ func (c *client) Org(ctx context.Context, u *model.User, owner string) (*model.O
|
||||
}, nil
|
||||
}
|
||||
|
||||
// helper function to return the GitHub oauth2 context using an HTTPClient that
|
||||
// newContext returns the GitHub oauth2 context using an HTTPClient that
|
||||
// disables TLS verification if disabled in the forge settings.
|
||||
func (c *client) newContext(ctx context.Context) context.Context {
|
||||
if !c.SkipVerify {
|
||||
@@ -406,7 +406,7 @@ func (c *client) newContext(ctx context.Context) context.Context {
|
||||
})
|
||||
}
|
||||
|
||||
// helper function to return the GitHub oauth2 config
|
||||
// newConfig returns the GitHub oauth2 config.
|
||||
func (c *client) newConfig() *oauth2.Config {
|
||||
scopes := []string{"user:email", "read:org"}
|
||||
if c.OnlyPublic {
|
||||
@@ -427,7 +427,7 @@ func (c *client) newConfig() *oauth2.Config {
|
||||
}
|
||||
}
|
||||
|
||||
// helper function to return the GitHub oauth2 client
|
||||
// newClientToken returns the GitHub oauth2 client.
|
||||
func (c *client) newClientToken(ctx context.Context, token string) *github.Client {
|
||||
ts := oauth2.StaticTokenSource(
|
||||
&oauth2.Token{AccessToken: token},
|
||||
@@ -447,7 +447,7 @@ func (c *client) newClientToken(ctx context.Context, token string) *github.Clien
|
||||
return client
|
||||
}
|
||||
|
||||
// helper function to return matching user email.
|
||||
// matchingEmail returns matching user email.
|
||||
func matchingEmail(emails []*github.UserEmail, rawURL string) *github.UserEmail {
|
||||
for _, email := range emails {
|
||||
if email.Email == nil || email.Primary == nil || email.Verified == nil {
|
||||
@@ -465,7 +465,7 @@ func matchingEmail(emails []*github.UserEmail, rawURL string) *github.UserEmail
|
||||
return nil
|
||||
}
|
||||
|
||||
// helper function to return matching hook.
|
||||
// matchingHooks returns matching hook.
|
||||
func matchingHooks(hooks []*github.Hook, rawurl string) *github.Hook {
|
||||
link, err := url.Parse(rawurl)
|
||||
if err != nil {
|
||||
@@ -493,7 +493,7 @@ func (c *client) Status(ctx context.Context, user *model.User, repo *model.Repo,
|
||||
if pipeline.Event == model.EventDeploy {
|
||||
// Get id from url. If not found, skip.
|
||||
matches := reDeploy.FindStringSubmatch(pipeline.ForgeURL)
|
||||
//nolint:gomnd
|
||||
//nolint:mnd
|
||||
if len(matches) != 2 {
|
||||
return nil
|
||||
}
|
||||
@@ -558,7 +558,7 @@ func (c *client) Branches(ctx context.Context, u *model.User, r *model.Repo, p *
|
||||
return branches, nil
|
||||
}
|
||||
|
||||
// BranchHead returns the sha of the head (latest commit) of the specified branch
|
||||
// BranchHead returns the sha of the head (latest commit) of the specified branch.
|
||||
func (c *client) BranchHead(ctx context.Context, u *model.User, r *model.Repo, branch string) (*model.Commit, error) {
|
||||
token := common.UserToken(ctx, r, u)
|
||||
b, _, err := c.newClientToken(ctx, token).Repositories.GetBranch(ctx, r.Owner, r.Name, branch, 1)
|
||||
|
Reference in New Issue
Block a user