From 30192f74868911396e786c964a08b98494f8ff59 Mon Sep 17 00:00:00 2001 From: Cezar Craciunoiu Date: Mon, 29 Apr 2024 17:57:54 +0300 Subject: [PATCH] fix(checkpatch): Assume bot defaults for some variables Signed-off-by: Cezar Craciunoiu --- cmd/governctl/pr/check/patch.go | 9 +++------ internal/config/config.go | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cmd/governctl/pr/check/patch.go b/cmd/governctl/pr/check/patch.go index 9b11b20..7f43541 100644 --- a/cmd/governctl/pr/check/patch.go +++ b/cmd/governctl/pr/check/patch.go @@ -29,9 +29,9 @@ import ( ) type Patch struct { - CommitterEmail string `long:"committer-email" short:"e" env:"GOVERN_COMMITTER_EMAIL" usage:"Set the Git committer author's email"` - CommiterGlobal bool `long:"committer-global" env:"GOVERN_COMMITTER_GLOBAL" usage:"Set the Git committer author's email/name globally"` - CommitterName string `long:"committer-name" short:"n" env:"GOVERN_COMMITTER_NAME" usage:"Set the Git committer author's name"` + CommitterEmail string `long:"committer-email" short:"e" env:"GOVERN_COMMITTER_EMAIL" usage:"Set the Git committer author's email" default:"monkey@unikraft.org"` + CommiterGlobal bool `long:"committer-global" env:"GOVERN_COMMITTER_GLOBAL" usage:"Set the Git committer author's email/name globally" default:"true"` + CommitterName string `long:"committer-name" short:"n" env:"GOVERN_COMMITTER_NAME" usage:"Set the Git committer author's name" default:"Unikraft Bot"` Output string `long:"output" short:"o" env:"GOVERN_OUTPUT" usage:"Set the output format of choice [table, html, json, yaml]" default:"table"` CheckpatchScript string `long:"checkpatch-script" env:"GOVERN_CHECKPATCH_SCRIPT" usage:"Use an existing checkpatch.pl script"` CheckpatchConf string `long:"checkpatch-conf" env:"GOVERN_CHECKPATCH_CONF" usage:"Use an existing checkpatch.conf file"` @@ -68,9 +68,6 @@ func NewPatch() *cobra.Command { func (opts *Patch) Run(ctx context.Context, args []string) error { var extraIgnores []string - fmt.Printf("opts: %v\n", opts) - fmt.Printf("%d\n", len(opts.CommitterName)) - ghOrg, ghRepo, ghPrId, err := cmdutils.ParseOrgRepoAndPullRequestArgs(args) if err != nil { return err diff --git a/internal/config/config.go b/internal/config/config.go index 47be8e3..e0fbe01 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -7,7 +7,7 @@ package config type Config struct { DryRun bool `long:"dry-run" short:"D" env:"GOVERN_DRY_RUN" usage:"Do not perform any actual change."` - GithubUser string `long:"github-user" env:"GOVERN_GITHUB_USER" usage:"GitHub User account name"` + GithubUser string `long:"github-user" env:"GOVERN_GITHUB_USER" usage:"GitHub User account name" default:"unikraft-bot"` GithubToken string `long:"github-token" env:"GOVERN_GITHUB_TOKEN" usage:"GitHub API token"` GithubEndpoint string `long:"github-endpoint" env:"GOVERN_GITHUB_ENDPOINT" short:"E" usage:"Alternative GitHub API endpoint (usually GitHub enterprise)"` GithubSkipSSL bool `long:"github-skip-ssl" short:"S" env:"GOVERN_GITHUB_SKIP_SSL" usage:"Skip SSL check with GitHub API endpoint"`