Skip to content

Commit 26faef5

Browse files
Fix spelling mistakes in comments, docs, and error strings (#3619)
* fix: correct spelling mistakes in comments, docs, and error strings Fix ~104 spelling mistakes found by codespell across 65 files. Fixes cover source comments, doc strings, markdown docs, error messages, and test strings. Intentional misspellings in cobra SuggestFor arrays and Kubernetes operator names are preserved. Fixes #3618 * chore: regenerate embedded filesystem after template spelling fix
1 parent 02faab0 commit 26faef5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+855
-855
lines changed

cmd/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ func (c buildConfig) Configure(f fn.Function) fn.Function {
304304
func (c buildConfig) Prompt() (buildConfig, error) {
305305
// If there is no registry nor explicit image name defined, the
306306
// Registry prompt is shown whether or not we are in confirm mode.
307-
// Otherwise, it is only showin if in confirm mode
307+
// Otherwise, it is only shown if in confirm mode
308308
// NOTE: the default in this latter situation will ignore the current function
309309
// value and will always use the value from the config (flag or env variable).
310310
// This is not strictly correct and will be fixed when Global Config: Function

cmd/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
// Test_NewTestClient ensures that the convenience method for
1111
// constructing a mocked client for testing properly considers options:
12-
// options provided to the factory constructor are considered exaustive,
12+
// options provided to the factory constructor are considered exhaustive,
1313
// such that the test can force the user of the factory to use specific mocks.
1414
// In other words, options provided when invoking the factory (such as by
1515
// a command implementation) are ignored.

cmd/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func newCreateConfig(cmd *cobra.Command, args []string, newClient ClientFactory)
187187
//
188188
// If this were to provide more complexity or unreasonable maintainability
189189
// in the future, we can move to ValidateFunctionName() function which will
190-
// print effectively "Note: func names cant start with '-\..." on errors
190+
// print effectively "Note: func names can't start with '-\..." on errors
191191
if err := detectPrefixHyphen(cmd); err != nil {
192192
return cfg, err
193193
}
@@ -310,7 +310,7 @@ func (c createConfig) Validate(client *fn.Client) (err error) {
310310
// Validate Runtime and Template Name
311311
//
312312
// Perhaps additional validation would be of use here in the CLI, but
313-
// the client libray itself is ultimately responsible for validating all input
313+
// the client library itself is ultimately responsible for validating all input
314314
// prior to exeuting any requests.
315315
// Client validates both language runtime and template exist, with language runtime
316316
// being a mandatory flag while defaulting template if not present to 'http'.

cmd/delete_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func TestDelete_ByName(t *testing.T) {
115115
}
116116
}
117117

118-
// TestDelete_Namespace ensures that remover is envoked when --namespace flag is
118+
// TestDelete_Namespace ensures that remover is invoked when --namespace flag is
119119
// given --> func delete myfunc --namespace myns
120120
func TestDelete_Namespace(t *testing.T) {
121121
var (

cmd/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ func ValidateBuilder(name string) (err error) {
452452
// for use in flags and help text.
453453
func KnownBuilders() builders.Known {
454454
// The set of builders supported by this CLI will likely always equate to
455-
// the set of builders enumerated in the builders pacakage.
455+
// the set of builders enumerated in the builders package.
456456
// However, future third-party integrations may support less than, or more
457457
// builders, and certain environmental considerations may alter this list.
458458

cmd/deploy_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ func TestDeploy_Envs(t *testing.T) {
399399
t.Fatalf("Expected envs '%v', got '%v'", expected, f.Run.Envs)
400400
}
401401

402-
// Deploy the function with an additinal environment variable.
402+
// Deploy the function with an additional environment variable.
403403
cmd = NewDeployCmd(NewTestClient())
404404
cmd.SetArgs([]string{"--env=ENV3=VAL3"})
405405
if err = cmd.Execute(); err != nil {
@@ -851,7 +851,7 @@ func TestDeploy_ImageWithDigestErrors(t *testing.T) {
851851
// just be deployed as is (since it already has digest)
852852
func TestDeploy_ImageWithDigestDoesntPopulateBuild(t *testing.T) {
853853
root := FromTempDirectory(t)
854-
// image with digest (well almost, atleast in length and syntax)
854+
// image with digest (well almost, at least in length and syntax)
855855
const img = "example.com/username@sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
856856
// Create a new Function in the temp directory
857857
_, err := fn.New().Init(fn.Function{Runtime: "go", Root: root})
@@ -1101,7 +1101,7 @@ func TestDeploy_NamespaceDefaultsToK8sContext(t *testing.T) {
11011101
// NOTE: The below logic is expected of all deployers at this time,
11021102
// but is not necessary for this test.
11031103
// Deployer implementations should have integration tests which confirm
1104-
// this minimim namespace resolution logic is respected:
1104+
// this minimum namespace resolution logic is respected:
11051105
/*
11061106
if f.Namespace != "" {
11071107
// We deployed to the requested namespace
@@ -1580,7 +1580,7 @@ func testRegistryOrImageRequired(cmdFn commandConstructor, t *testing.T) {
15801580
// are properly respected for all permutations, including empty.
15811581
func TestDeploy_RemoteBuildURLPermutations(t *testing.T) {
15821582
// Valid flag permutations (empty indicates flag should be omitted)
1583-
// and a functon which will convert a permutation into flags for use
1583+
// and a function which will convert a permutation into flags for use
15841584
// by the subtests.
15851585
// The empty string indicates the case in which the flag is not provided.
15861586
var (
@@ -1957,7 +1957,7 @@ func TestDeploy_NoErrorOnOldFunctionNotFound(t *testing.T) {
19571957
// if it received an apiErrors.IsNotFound(err) and if so returns
19581958
// a fn.ErrFunctionNotFound. This test implementation is dependent
19591959
// on that. This is a change from the original implementation which
1960-
// directly returned a knative erorr with:
1960+
// directly returned a knative error with:
19611961
// return apiErrors.NewNotFound(schema.GroupResource{Group: "", Resource: "Namespace"}, nsOne)
19621962
if ns == nsOne {
19631963
// Fabricate a not-found error. For example if the function

cmd/func-util/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func (d deployDecorator) UpdateLabels(function fn.Function, labels map[string]st
208208

209209
func sh(ctx context.Context) error {
210210
if !slices.Equal(os.Args[1:], []string{"-c", "umask 0000 && exec tar -xmf -"}) {
211-
return fmt.Errorf("this is a fake sh (only for backward compatiblility purposes)")
211+
return fmt.Errorf("this is a fake sh (only for backward compatibility purposes)")
212212
}
213213

214214
wd, err := os.Getwd()

cmd/func-util/socat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func tryCloseWriteSide(c connection) {
135135
if wc, ok := c.(writeCloser); ok {
136136
err := wc.CloseWrite()
137137
if err != nil {
138-
fmt.Fprintf(os.Stderr, "waring: cannot close write side: %+v\n", err)
138+
fmt.Fprintf(os.Stderr, "warning: cannot close write side: %+v\n", err)
139139
}
140140
}
141141
}

cmd/list_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestList_Namespace(t *testing.T) {
2424
err bool // expected error
2525
}{
2626
{
27-
name: "default (none specififed)",
27+
name: "default (none specified)",
2828
namespace: "",
2929
all: false,
3030
allShort: false,

cmd/repository.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ func runRepositoryAdd(_ *cobra.Command, args []string, newClient ClientFactory)
344344
// Create a client instance which utilizes the given repositories path.
345345
// Note that this MAY not be in the config structure if the environment
346346
// variable to override said path was provided explicitly.
347-
// TODO: rectify this inconsitency: the config default path structure will
347+
// TODO: rectify this inconsistency: the config default path structure will
348348
// be created in XDG_CONFIG_HOME/func even if the repo path environment
349349
// was set to some other location on disk.
350350
client, done := newClient(ClientConfig{Verbose: cfg.Verbose})
@@ -514,7 +514,7 @@ func runRepositoryRemove(_ *cobra.Command, args []string, newClient ClientFactor
514514
params.Name = args[0]
515515
}
516516
// "Are you sure" confirmation flag
517-
// (not using name 'Confirm' to avoid confustion with cfg.Confirm)
517+
// (not using name 'Confirm' to avoid confusion with cfg.Confirm)
518518
// defaults to Yes. This is debatable, but I don't want to choose the repo
519519
// to remove and then have to see a prompt and then have to hit 'y'. Just
520520
// prompting once to make sure, which requires another press of enter, seems
@@ -587,7 +587,7 @@ func runRepositoryRemove(_ *cobra.Command, args []string, newClient ClientFactor
587587
// Installed repositories
588588
// All repositories which have been installed (does not include builtin)
589589
func installedRepositories(client *fn.Client) ([]string, error) {
590-
// Client API contract stipulates the list always lists the defeault builtin
590+
// Client API contract stipulates the list always lists the default builtin
591591
// repo, and always lists it at index 0
592592
repositories, err := client.Repositories().List()
593593
if err != nil {
@@ -635,7 +635,7 @@ func newRepositoryConfig() (cfg repositoryConfig, err error) {
635635
return
636636
}
637637

638-
// prompt returns a config with values populated from interactivly prompting
638+
// prompt returns a config with values populated from interactively prompting
639639
// the user.
640640
func (c repositoryConfig) prompt() (repositoryConfig, error) {
641641
// These prompts are overly verbose, as the user calling --confirm likely

0 commit comments

Comments
 (0)