diff --git a/ci/circleci/runner/src/circlerunner.py b/ci/circleci/runner/src/circlerunner.py index 30d72078..aec52868 100755 --- a/ci/circleci/runner/src/circlerunner.py +++ b/ci/circleci/runner/src/circlerunner.py @@ -116,7 +116,7 @@ def security_validation(self, file_path): """validate file security for runner execution, besides file existence, the file needs to pass the following validation: 1. it needs to be owned by root - 2. it needs to be only readable (and optionaly executable) + 2. it needs to be only readable (and optionally executable) by owner(root) (mode 500 or 400) """ self.logger.debug(f"validating script file {file_path}") diff --git a/ci/circleci/runner/src/macrunner.py b/ci/circleci/runner/src/macrunner.py index c3026495..21cb1365 100755 --- a/ci/circleci/runner/src/macrunner.py +++ b/ci/circleci/runner/src/macrunner.py @@ -90,7 +90,7 @@ def do_the_job(self, job_name, job_params): for local_path in files: self.upload_file_to_s3(source_file_path=local_path, s3_path=s3_path) else: - raise Exception(f"unknow job to execute {job_name}") + raise Exception(f"unknown job to execute {job_name}") if __name__ == "__main__": parser = optparse.OptionParser() diff --git a/cmd/auth/login_test.go b/cmd/auth/login_test.go index a085ef09..e0d6c8f8 100644 --- a/cmd/auth/login_test.go +++ b/cmd/auth/login_test.go @@ -40,7 +40,7 @@ var mockOrgAuth = types.SlackAuth{ } var mockOrgAuthURL = "https://url.com" -func TestLoginCommmand(t *testing.T) { +func TestLoginCommand(t *testing.T) { testutil.TableTestCommand(t, testutil.CommandTests{ "errors when the challenge flag is provided without the ticket flag": { CmdArgs: []string{"--challenge=achallengestring"}, diff --git a/cmd/datastore/query_test.go b/cmd/datastore/query_test.go index e7b74363..2234dd18 100644 --- a/cmd/datastore/query_test.go +++ b/cmd/datastore/query_test.go @@ -278,7 +278,7 @@ func TestQueryCommand(t *testing.T) { Option: "status", Index: 0, }, nil) - clientsMock.IO.On("SelectPrompt", mock.Anything, "Slect an attribute for '#task_id'", mock.Anything, iostreams.MatchPromptConfig(iostreams.SelectPromptConfig{ + clientsMock.IO.On("SelectPrompt", mock.Anything, "Select an attribute for '#task_id'", mock.Anything, iostreams.MatchPromptConfig(iostreams.SelectPromptConfig{ Flag: clientsMock.Config.Flags.Lookup("attributes"), })).Return(iostreams.SelectPromptResponse{ Prompt: true, diff --git a/cmd/manifest/validate.go b/cmd/manifest/validate.go index 6ae91a74..77cf3dc0 100644 --- a/cmd/manifest/validate.go +++ b/cmd/manifest/validate.go @@ -124,7 +124,7 @@ func newValidateLogger(clients *shared.ClientFactory, cmd *cobra.Command) *logge ) } -// gatherAuthenticationToken returns some user token and configures authenication +// gatherAuthenticationToken returns some user token and configures authentication // internals for API use func gatherAuthenticationToken(ctx context.Context, clients *shared.ClientFactory) (auth types.SlackAuth, err error) { defer func() { diff --git a/cmd/project/create_samples.go b/cmd/project/create_samples.go index 685c0d29..e21b1dbd 100644 --- a/cmd/project/create_samples.go +++ b/cmd/project/create_samples.go @@ -74,7 +74,7 @@ func filterRepos(sampleRepos []create.GithubRepo, projectType string) []create.G return filteredRepos } -// sortRepos sorts the provided repostiories by the +// sortRepos sorts the provided repositories by the // StargazersCount field in descending order func sortRepos(sampleRepos []create.GithubRepo) []create.GithubRepo { sortedRepos := sampleRepos diff --git a/internal/api/workflows_test.go b/internal/api/workflows_test.go index ad24fd77..015c5e8f 100644 --- a/internal/api/workflows_test.go +++ b/internal/api/workflows_test.go @@ -421,8 +421,8 @@ func Test_API_WorkflowTriggersList(t *testing.T) { argsLimit: 4, argsCursor: "", argsType: "fake_type", - httpResponseJSON: `{"ok":false,"error":"invaild_arguments"}`, - expectedErrorContains: "invaild_arguments", + httpResponseJSON: `{"ok":false,"error":"invalid_arguments"}`, + expectedErrorContains: "invalid_arguments", }, } diff --git a/internal/app/app.go b/internal/app/app.go index 9f741348..d7491c26 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -137,7 +137,7 @@ func regexReplaceAppNameInManifest(src []byte, appName string) []byte { // // Expression explained: // (?m) - Multi-line match that enables the use of ^ and $ - // #1 - Match $1 captures start of content to the `Manifest({` function with optional whitepsace between the name, bracket `(```, and brace `{` + // #1 - Match $1 captures start of content to the `Manifest({` function with optional whitespace between the name, bracket `(```, and brace `{` // #2 - Continue match $1 unless a closing brace `}` is encountered // #3 - Continue match $1 to the `name` key surrounded by optional single or double quotes // #4 - Continue match $1 ignoring whitespace followed by a colon `:` and the opening single or double quotes of the string's value diff --git a/internal/app/app_client_test.go b/internal/app/app_client_test.go index 013baba5..df6ff4aa 100644 --- a/internal/app/app_client_test.go +++ b/internal/app/app_client_test.go @@ -638,7 +638,7 @@ func TestAppClient_CleanupSlackFolder(t *testing.T) { require.NoError(t, err) assert.False(t, ac.config.ProjectConfig.ProjectConfigJSONFileExists(wd), - "an unexepcted config was found") + "an unexpected config was found") dotSlackFolder := filepath.Dir(pathToAppsJSON) _, err = ac.fs.Stat(dotSlackFolder) diff --git a/internal/cmdutil/flags.go b/internal/cmdutil/flags.go index 5989145d..6448b36a 100644 --- a/internal/cmdutil/flags.go +++ b/internal/cmdutil/flags.go @@ -29,7 +29,7 @@ const ( ) // OrgGrantWorkspaceDescription is the description for for --org-workspace-grant flag in the run, deploy and install commands -// This vaue is a function so that formatting is applied for the help page (when style is enabled). +// This value is a function so that formatting is applied for the help page (when style is enabled). var OrgGrantWorkspaceDescription = func() string { return fmt.Sprintf("grant access to a specific org workspace ID\n %s", style.Secondary("(or 'all' for all workspaces in the org)")) diff --git a/internal/config/manifest_test.go b/internal/config/manifest_test.go index 5312e9a9..73761e3d 100644 --- a/internal/config/manifest_test.go +++ b/internal/config/manifest_test.go @@ -63,7 +63,7 @@ func Test_Config_ManifestSource_Exists(t *testing.T) { expected: true, }, "unknown source exists": { - a: "unknonwn", + a: "unknown", expected: true, }, "missing source does not exist": { diff --git a/internal/config/system_test.go b/internal/config/system_test.go index 7035a5be..590251ab 100644 --- a/internal/config/system_test.go +++ b/internal/config/system_test.go @@ -575,7 +575,7 @@ func Test_SystemConfig_writeConfigFile(t *testing.T) { wg.Done() }() - // Step 3) Wait a few seconds to guarantee Step 2) go rountine executes first + // Step 3) Wait a few seconds to guarantee Step 2) go routine executes first time.Sleep(50 * time.Millisecond) // Step 4) Unlock the file so that Step 2) can stop waiting and write the config file diff --git a/internal/hooks/script_test.go b/internal/hooks/script_test.go index 89c59602..ad2c61a0 100644 --- a/internal/hooks/script_test.go +++ b/internal/hooks/script_test.go @@ -89,7 +89,7 @@ func Test_HookScript_Get(t *testing.T) { expectedError: nil, expectedCommand: "npm start", }, - "Cmmand does not exist": { + "Command does not exist": { hookScript: &HookScript{Name: "start", Command: ""}, expectedError: slackerror.New(slackerror.ErrSDKHookNotFound).WithMessage("The command for 'start' was not found"), expectedCommand: "", diff --git a/internal/iostreams/reader.go b/internal/iostreams/reader.go index 4e0ef320..350fa382 100644 --- a/internal/iostreams/reader.go +++ b/internal/iostreams/reader.go @@ -18,7 +18,7 @@ import ( "io" ) -// Reader contains implmentations of a Read methods for various inputs methods +// Reader contains implementations of a Read methods for various inputs methods // // Only stdin is supported for now type Reader interface { diff --git a/internal/logger/logevent.go b/internal/logger/logevent.go index b73bc027..3a622e95 100644 --- a/internal/logger/logevent.go +++ b/internal/logger/logevent.go @@ -30,7 +30,7 @@ type LogEvent struct { Data LogData } -// DataToString safetly returns the Data[key] value as a string +// DataToString safely returns the Data[key] value as a string func (l *LogEvent) DataToString(key string) string { var defaultValue string @@ -48,7 +48,7 @@ func (l *LogEvent) DataToString(key string) string { } } -// DataToString safetly returns the Data[key] value as a string +// DataToString safely returns the Data[key] value as a string func (l *LogEvent) DataToStringSlice(key string) []string { defaultValue := make([]string, 0) @@ -66,7 +66,7 @@ func (l *LogEvent) DataToStringSlice(key string) []string { } } -// DataToBool safetly returns the Data[key] value as a bool +// DataToBool safely returns the Data[key] value as a bool func (l *LogEvent) DataToBool(key string) bool { var defaultValue bool @@ -84,7 +84,7 @@ func (l *LogEvent) DataToBool(key string) bool { } } -// DataToBool safetly returns the Data[key] value as a bool +// DataToBool safely returns the Data[key] value as a bool func (l *LogEvent) DataToInt(key string) int { var defaultValue int diff --git a/internal/pkg/apps/install.go b/internal/pkg/apps/install.go index 5220846f..1b42cdd3 100644 --- a/internal/pkg/apps/install.go +++ b/internal/pkg/apps/install.go @@ -543,7 +543,7 @@ func InstallLocalApp(ctx context.Context, clients *shared.ClientFactory, orgGran // here before installing the application. This includes interactivity and event // subscriptions as specified through Run On Slack hosting requirements. // -// The CLI determines the API host from selected credentials during installaion. +// The CLI determines the API host from selected credentials during installation. // // Apps without a specified or a "remote" function runtime should ignore this. func configureHostedManifest( diff --git a/internal/pkg/platform/activity_test.go b/internal/pkg/platform/activity_test.go index ee15e6ad..2b1d14f1 100644 --- a/internal/pkg/platform/activity_test.go +++ b/internal/pkg/platform/activity_test.go @@ -271,11 +271,11 @@ func TestPlatformActivity_TriggerExecutedToString(t *testing.T) { func Test_datastoreRequestResultToString(t *testing.T) { for name, tt := range map[string]struct { - activty api.Activity + activity api.Activity expectedResults []string }{ "successful datastore request event log": { - activty: api.Activity{ + activity: api.Activity{ Payload: map[string]interface{}{ "datastore_name": "MyDatastore", "request_type": "get", @@ -285,11 +285,11 @@ func Test_datastoreRequestResultToString(t *testing.T) { expectedResults: []string{"MyDatastore", "get", "succeeded", "f7d1253f-4066-4b83-8330-a483ff555c20"}, }, "successful datastore request event log with nil payload": { - activty: api.Activity{}, + activity: api.Activity{}, expectedResults: []string{"succeeded"}, }, "failed datastore request error log": { - activty: api.Activity{ + activity: api.Activity{ Level: "error", Payload: map[string]interface{}{ "datastore_name": "MyDatastore", @@ -301,7 +301,7 @@ func Test_datastoreRequestResultToString(t *testing.T) { expectedResults: []string{"MyDatastore", "query", "failed", "ValidationException", "f7d1253f-4066-4b83-8330-a483ff555c20"}, }, "failed datastore request without error field": { - activty: api.Activity{ + activity: api.Activity{ Level: "error", Payload: map[string]interface{}{ "datastore_name": "MyDatastore", @@ -313,7 +313,7 @@ func Test_datastoreRequestResultToString(t *testing.T) { }, } { t.Run(name, func(t *testing.T) { - actualResult := datastoreRequestResultToString(tt.activty) + actualResult := datastoreRequestResultToString(tt.activity) for _, expectedResult := range tt.expectedResults { require.Contains(t, actualResult, expectedResult) } diff --git a/internal/prompts/app_select.go b/internal/prompts/app_select.go index 8693d863..a1721abd 100644 --- a/internal/prompts/app_select.go +++ b/internal/prompts/app_select.go @@ -1685,7 +1685,7 @@ func TeamAppSelectPrompt(ctx context.Context, clients *shared.ClientFactory, env WithMessage("No credentials found for team \"%s\"", selectedDomain) } -// OrgSelectWorkspacePrompt prompts the user to select a single workspace to grant app access to, or grant all workspaces wihtin the org. +// OrgSelectWorkspacePrompt prompts the user to select a single workspace to grant app access to, or grant all workspaces within the org. func OrgSelectWorkspacePrompt(ctx context.Context, clients *shared.ClientFactory, orgDomain, token string, topOptionAllWorkspaces bool) (string, error) { teams, paginationCursor, err := clients.ApiInterface().AuthTeamsList(ctx, token, api.DefaultAuthTeamsListPageSize) if err != nil { diff --git a/internal/prompts/app_select_test.go b/internal/prompts/app_select_test.go index b33084c4..06d638b6 100644 --- a/internal/prompts/app_select_test.go +++ b/internal/prompts/app_select_test.go @@ -147,7 +147,7 @@ var ( Installed: true, Hosted: true, } - deployedTeam2UnistalledAppStatus = api.AppStatusResultAppInfo{ + deployedTeam2UninstalledAppStatus = api.AppStatusResultAppInfo{ AppID: deployedTeam2UninstalledAppID, Installed: false, Hosted: true, @@ -1490,7 +1490,7 @@ func TestPrompt_AppSelectPrompt_ShowExpectedLabels(t *testing.T) { Index: test.selectedTeamIndex, }, nil) - // On choosed deployed or local + // On chosen deployed or local clientsMock.IO.On(SelectPrompt, mock.Anything, "Choose an app environment", test.expectedAppLabels, iostreams.MatchPromptConfig(iostreams.SelectPromptConfig{ Flag: clientsMock.Config.Flags.Lookup("app"), })).Return(iostreams.SelectPromptResponse{ @@ -1568,7 +1568,7 @@ func TestPrompt_AppSelectPrompt_GetApps(t *testing.T) { }, mockTeam2Status: api.GetAppStatusResult{ Apps: []api.AppStatusResultAppInfo{ - deployedTeam2UnistalledAppStatus, + deployedTeam2UninstalledAppStatus, localTeam2InstalledAppStatus, }, }, diff --git a/internal/slackerror/error.go b/internal/slackerror/error.go index b9edbf5f..15b7cce9 100644 --- a/internal/slackerror/error.go +++ b/internal/slackerror/error.go @@ -224,7 +224,7 @@ func (e *Error) recursiveUnwrapWithLimit(maxDepth int) *Error { // base case if e.Cause == nil || maxDepth == 0 { // if we get to an error with no cause then we have the innermost error so we should stop here. - // OR if we have exausted the depth allowed then we should also stop here and return this error + // OR if we have exhausted the depth allowed then we should also stop here and return this error return e } diff --git a/internal/update/autoupdate_test.go b/internal/update/autoupdate_test.go index 389c9eeb..f43dec0f 100644 --- a/internal/update/autoupdate_test.go +++ b/internal/update/autoupdate_test.go @@ -217,7 +217,7 @@ func verifyFileContainsVersion(file, version string, t *testing.T) { "expected file %s to contain %s, but instead was '%s'", file, version, strContents) } -// zip creates a new zip archive at destination containing a singl +// zip creates a new zip archive at destination containing a single // file at path with the given contents func zipArchive(files []testFile, destination string, t *testing.T) { destFile, err := os.OpenFile(destination, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0600) diff --git a/internal/update/cli_autoupdate.go b/internal/update/cli_autoupdate.go index c5a735ec..39c37c4b 100644 --- a/internal/update/cli_autoupdate.go +++ b/internal/update/cli_autoupdate.go @@ -248,7 +248,7 @@ func restoreBinary(updatedBinaryFolderPath string, newPathToOldBinary string, or // getUpdateFilename returns name of the archive that contains the upgrade for the given version and OS func getUpdateFileName(version, operatingSys string) (filename string, err error) { // You can get a list of all possible OS/architecture combinations with `go tool dist list | column -c 75 | column -t` - // TODO: account for architecture as well. M1 macs would have an arch of arm64 instead of the ususal amd64 + // TODO: account for architecture as well. M1 macs would have an arch of arm64 instead of the usual amd64 const binaryName = "slack_cli" const architecture = "64-bit" switch operatingSys {