Skip to content

Commit cc7ecb6

Browse files
chmouelGemini
andcommitted
chore: Enhance text consistency across codebase
- Standardized "Pipelines as Code" to "Pipelines-as-Code" in CLI command descriptions. - Corrected typos and grammatical errors in command help texts and flag descriptions. - Improved capitalization for proper nouns like "URI", "Kubernetes", "Tekton", "HTTPS", and "Hub" in error messages and log outputs. - Refined error messages for clarity when remote tasks or pipelines are not found. - Updated internal comments for better readability and grammar. Co-authored-by: Gemini <gemini@google.com> Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
1 parent 6a02e5e commit cc7ecb6

23 files changed

+113
-112
lines changed

hack/update-golden.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
2-
# This will run `go test a/package -test.update-golden=true` on all packages that are importing `gotest.tools/v3/golden`
3-
# This will update the golden files with the current output.
4-
# Run this only when you are sure the output is meant to change.
5-
go test $(go list -f '{{ .ImportPath }} {{ .TestImports }}' ./... | grep gotest.tools/v3/golden | awk '{print $1}' | tr '\n' ' ') -test.update-golden=true
2+
# This script runs `go test -test.update-golden=true` for all packages that import `gotest.tools/v3/golden`.
3+
# It updates golden files to match the current test output.
4+
# Use this only when you intend to update the expected output.
5+
# Note: This script targets unit tests only. To update golden files for e2e tests,
6+
# run the e2e tests directly with the appropriate variables environemnt set and the -test.update-golden=true flag.
7+
go test $(go list -f '{{ .ImportPath }} {{ .TestImports }}' ./pkg/... | grep gotest.tools/v3/golden | awk '{print $1}' | tr '\n' ' ') -test.update-golden=true

pkg/cmd/tknpac/bootstrap/bootstrap.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ const indexTmpl = `
7171
`
7272

7373
var successTmpl = fmt.Sprintf(`
74-
<html><body>You have <span style=\"color: green\">successfully</span> created a new GitHub application, go back to the %s pac cli to finish the installation.</body></html>
74+
<html><body>You have <span style=\"color: green\">successfully</span> created a new GitHub application. Return to the %s pac CLI to finish the installation.</body></html>
7575
`, settings.TknBinaryName)
7676

7777
func install(ctx context.Context, run *params.Run, opts *bootstrapOpts) error {
7878
if !opts.forceInstall {
79-
fmt.Fprintln(opts.ioStreams.Out, "=> Checking if Pipelines as Code is installed.")
79+
fmt.Fprintln(opts.ioStreams.Out, "=> Checking if Pipelines-as-Code is installed.")
8080
}
8181
tektonInstalled, err := checkPipelinesInstalled(run)
8282
if err != nil {

pkg/cmd/tknpac/bootstrap/bootstrap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestInstall(t *testing.T) {
4949
err := install(ctx, run, opts)
5050
// get an error because i need to figure out how to fake dynamic client
5151
assert.Assert(t, err != nil)
52-
assert.Equal(t, "=> Checking if Pipelines as Code is installed.\n", out.String())
52+
assert.Equal(t, "=> Checking if Pipelines-as-Code is installed.\n", out.String())
5353
}
5454

5555
func TestDetectPacInstallation(t *testing.T) {

pkg/cmd/tknpac/create/repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func getRepoURL(opts *RepoOptions) error {
216216
return nil
217217
}
218218

219-
q := "Enter the Git repository url "
219+
q := "Enter the Git repository URL "
220220
var err error
221221
if opts.GitInfo.URL != "" {
222222
opts.GitInfo.URL, err = cleanupGitURL(opts.GitInfo.URL)

pkg/cmd/tknpac/create/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ func Root(clients *params.Run, ioStreams *cli.IOStreams) *cobra.Command {
1010
cmd := &cobra.Command{
1111
Use: "create",
1212
Aliases: []string{},
13-
Short: "Create Pipelines as Code resources",
14-
Long: `Create Pipelines as Code resources`,
13+
Short: "Create Pipelines-as-Code resources",
14+
Long: `Create Pipelines-as-Code resources such as repositories, webhook configurations, and other related components. This command helps you set up and configure Pipelines-as-Code in your cluster.`,
1515
SilenceUsage: true,
1616
Annotations: map[string]string{
1717
"commandType": "main",

pkg/cmd/tknpac/create/testdata/TestGenerateTemplate-WithGitInfo.golden

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ kind: PipelineRun
44
metadata:
55
name: tartanpion
66
annotations:
7-
# The event we are targeting as seen from the webhook payload
7+
# The event we target as seen from the webhook payload
88
# this can be an array too, i.e: [pull_request, push]
99
pipelinesascode.tekton.dev/on-event: "[pull_request, push]"
1010

11-
# The branch or tag we are targeting (ie: main, refs/tags/*)
11+
# The branch or tag we target (i.e., main, refs/tags/*)
1212
pipelinesascode.tekton.dev/on-target-branch: "[main]"
1313

14-
# Fetch the git-clone task from hub, we are able to reference later on it
14+
# Fetch the git-clone task from hub, we can reference later on it
1515
# with taskRef and it will automatically be embedded into our pipeline.
1616
pipelinesascode.tekton.dev/task: "git-clone"
1717

@@ -28,8 +28,8 @@ metadata:
2828
pipelinesascode.tekton.dev/max-keep-runs: "5"
2929
spec:
3030
params:
31-
# The variable with brackets are special to Pipelines as Code
32-
# They will automatically be expanded with the events from Github.
31+
# The variable with brackets are special to Pipelines-as-Code
32+
# They will automatically be expanded with the events from GitHub.
3333
- name: repo_url
3434
value: "{{ repo_url }}"
3535
- name: revision

pkg/cmd/tknpac/create/testdata/TestGenerateTemplate-WithoutGitInfo.golden

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ kind: PipelineRun
44
metadata:
55
name: tartanpion
66
annotations:
7-
# The event we are targeting as seen from the webhook payload
7+
# The event we target as seen from the webhook payload
88
# this can be an array too, i.e: [pull_request, push]
99
pipelinesascode.tekton.dev/on-event: "[pull_request, push]"
1010

11-
# The branch or tag we are targeting (ie: main, refs/tags/*)
11+
# The branch or tag we target (i.e., main, refs/tags/*)
1212
pipelinesascode.tekton.dev/on-target-branch: "[main]"
1313

14-
# Fetch the git-clone task from hub, we are able to reference later on it
14+
# Fetch the git-clone task from hub, we can reference later on it
1515
# with taskRef and it will automatically be embedded into our pipeline.
1616
pipelinesascode.tekton.dev/task: "git-clone"
1717

@@ -28,8 +28,8 @@ metadata:
2828
pipelinesascode.tekton.dev/max-keep-runs: "5"
2929
spec:
3030
params:
31-
# The variable with brackets are special to Pipelines as Code
32-
# They will automatically be expanded with the events from Github.
31+
# The variable with brackets are special to Pipelines-as-Code
32+
# They will automatically be expanded with the events from GitHub.
3333
- name: repo_url
3434
value: "{{ repo_url }}"
3535
- name: revision

pkg/cmd/tknpac/deleterepo/delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func repositoryCommand(run *params.Run, ioStreams *cli.IOStreams) *cobra.Command
2626
cmd := &cobra.Command{
2727
Args: cobra.MinimumNArgs(0),
2828
Use: "repository",
29-
Short: "Delete a Pipelines as Code Repository or multiple of them",
29+
Short: "Delete a Pipelines-as-Code repository or multiple repositories",
3030
Long: longHelp,
3131
Aliases: []string{"repo"},
3232
ValidArgsFunction: func(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) {

pkg/cmd/tknpac/deleterepo/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ func Root(clients *params.Run, ioStreams *cli.IOStreams) *cobra.Command {
1010
cmd := &cobra.Command{
1111
Use: "delete",
1212
Aliases: []string{"rm"},
13-
Short: "Delete Pipelines as Code resources",
14-
Long: `Delete Pipelines as Code resources`,
13+
Short: "Delete Pipelines-as-Code resources",
14+
Long: `Delete Pipelines-as-Code resources`,
1515
SilenceUsage: true,
1616
Annotations: map[string]string{
1717
"commandType": "main",

pkg/cmd/tknpac/generate/generate.go

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ func Command(_ *params.Run, ioStreams *cli.IOStreams) *cobra.Command {
5555
cmd := &cobra.Command{
5656
Use: "generate",
5757
Aliases: []string{"gen"},
58-
Short: "Generate PipelineRun",
58+
Short: "Generate a PipelineRun",
5959
RunE: func(_ *cobra.Command, _ []string) error {
6060
gopt.CLIOpts = cli.NewCliOptions()
6161
gopt.IOStreams.SetColorEnabled(!gopt.CLIOpts.NoColoring)
6262

6363
if gopt.generateWithClusterTask {
64-
return fmt.Errorf("ClusterTasks is deprecated and not available anymore")
64+
return fmt.Errorf("ClusterTasks are deprecated and not available anymore")
6565
}
6666
cwd, err := os.Getwd()
6767
if err != nil {
@@ -75,17 +75,17 @@ func Command(_ *params.Run, ioStreams *cli.IOStreams) *cobra.Command {
7575
},
7676
}
7777
cmd.PersistentFlags().StringVar(&gopt.Event.BaseBranch, "branch", "",
78-
"The target branch for the PipelineRun to handle (eg: main, nightly)")
78+
"Target branch for the PipelineRun to handle (e.g., main, nightly)")
7979
cmd.PersistentFlags().StringVar(&gopt.Event.EventType, "event-type", "",
80-
"The event type of the repository event to handle (eg: pull_request, push)")
80+
"Event type of the repository event to handle (e.g., pull_request, push)")
8181
cmd.PersistentFlags().StringVar(&gopt.pipelineRunName, "pipeline-name", "",
82-
"The pipeline name")
82+
"Pipeline name")
8383
cmd.PersistentFlags().StringVarP(&gopt.FileName, "file-name", "f", "",
84-
"The file name location")
84+
"File name location")
8585
cmd.PersistentFlags().BoolVar(&gopt.overwrite, "overwrite", false,
86-
"Whether to overwrite the file if it exist")
86+
"Whether to overwrite the file if it exists")
8787
cmd.PersistentFlags().StringVarP(&gopt.language, "language", "l", "",
88-
"Generate for this programming language")
88+
"Generate template for this programming language")
8989
cmd.PersistentFlags().BoolVarP(&gopt.generateWithClusterTask, "use-clustertasks", "", false,
9090
"Deprecated, not available anymore")
9191
_ = cmd.PersistentFlags().MarkDeprecated("use-clustertasks", "This flag will be removed in a future release")
@@ -148,9 +148,9 @@ func (o *Opts) branchOrTag() error {
148148
o.Event.BaseBranch = mainBranch
149149

150150
if o.Event.EventType == triggertype.PullRequest.String() {
151-
msg = "Enter the target GIT branch for the Pull Request (default: %s): "
151+
msg = "Enter the target Git branch for the Pull Request (default: %s): "
152152
} else if o.Event.EventType == "push" {
153-
msg = "Enter a target GIT branch or a tag for the push (default: %s)"
153+
msg = "Enter a target Git branch or tag for the push (default: %s)"
154154
}
155155

156156
if err := prompt.SurveyAskOne(
@@ -207,17 +207,16 @@ func (o *Opts) samplePipeline(recreateTemplate bool) error {
207207
if _, err := os.Stat(fpath); !os.IsNotExist(err) && !o.overwrite {
208208
if recreateTemplate {
209209
var overwrite bool
210-
msg := fmt.Sprintf("There is already a file named: %s would you like me to override it?", relpath)
210+
msg := fmt.Sprintf("A file named %s already exists. Would you like to override it?", relpath)
211211
if err := prompt.SurveyAskOne(&survey.Confirm{Message: msg, Default: false}, &overwrite); err != nil {
212212
return err
213213
}
214214
if !overwrite {
215-
fmt.Fprintf(o.IOStreams.ErrOut, "%s Not overwriting file, exiting...\n", cs.WarningIcon())
216-
fmt.Fprintf(o.IOStreams.ErrOut, "%s Feel free to use the -f flag if you want to target another file name\n...", cs.InfoIcon())
215+
fmt.Fprintf(o.IOStreams.ErrOut, "%s File not overwritten, exiting...\n", cs.WarningIcon())
216+
fmt.Fprintf(o.IOStreams.ErrOut, "%s Use the -f flag to specify a different file name.\n", cs.InfoIcon())
217217
}
218218
} else {
219-
fmt.Fprintf(o.IOStreams.Out, "%s There is already a file named: %s, skipping template generation, feel free to use \"%s pac generate\" command to generate sample template.\n", cs.InfoIcon(), relpath,
220-
settings.TknBinaryName)
219+
fmt.Fprintf(o.IOStreams.Out, "%s File %s already exists, skipping template generation. Use \"%s pac generate\" to generate a sample template.\n", cs.InfoIcon(), relpath, settings.TknBinaryName)
221220
}
222221
return nil
223222
}

0 commit comments

Comments
 (0)