From cd36c9f041be9ec11756db23c0bbd36a6719a6eb Mon Sep 17 00:00:00 2001 From: JtheBAB <42135332+JtheBAB@users.noreply.github.com> Date: Mon, 2 Mar 2020 17:10:41 +0100 Subject: [PATCH] MM-22355 - Fix typos detected by goreportcad.com (#13842) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update webhook_test.go * Update user_test.go * Update filesstore_test.go * Update plugin_requests.go * Update syncables.go * Update helper.go * Update html_entities.go * Update user.go * Update team.go * Update notification.go * Update notification_test.go * Update plugin_api_test.go * Update post_metadata.go * Update channel_test.go * Update database.go * Update channel.go * Update user_store.go * Update team_test.go * revert andd * Revert back to infintie Co-authored-by: Jesús Espino Co-authored-by: mattermod --- api4/channel.go | 2 +- api4/channel_test.go | 2 +- api4/team.go | 4 ++-- api4/user_test.go | 2 +- app/notification.go | 2 +- app/notification_test.go | 2 +- app/plugin_api_test.go | 2 +- app/plugin_requests.go | 2 +- app/post_metadata.go | 2 +- app/syncables.go | 4 ++-- cmd/mattermost/commands/team_test.go | 2 +- cmd/mattermost/commands/user.go | 2 +- cmd/mattermost/commands/webhook_test.go | 2 +- config/database.go | 2 +- services/filesstore/filesstore_test.go | 2 +- store/sqlstore/user_store.go | 2 +- testlib/helper.go | 2 +- 17 files changed, 19 insertions(+), 19 deletions(-) diff --git a/api4/channel.go b/api4/channel.go index 8e02fa9324..3c57174bf6 100644 --- a/api4/channel.go +++ b/api4/channel.go @@ -1163,7 +1163,7 @@ func viewChannel(c *Context, w http.ResponseWriter, r *http.Request) { } // Validate view struct - // Check IDs are valid or blank. Blank IDs are used to denote focus loss or inital channel view. + // Check IDs are valid or blank. Blank IDs are used to denote focus loss or initial channel view. if view.ChannelId != "" && !model.IsValidId(view.ChannelId) { c.SetInvalidParam("channel_view.channel_id") return diff --git a/api4/channel_test.go b/api4/channel_test.go index adb26fc9b9..45c6e06cbe 100644 --- a/api4/channel_test.go +++ b/api4/channel_test.go @@ -2828,7 +2828,7 @@ func TestUpdateChannelScheme(t *testing.T) { _, resp = th.Client.UpdateChannelScheme(channel.Id, channelScheme.Id) CheckForbiddenStatus(t, resp) - // Test that a license is requried. + // Test that a license is required. th.App.SetLicense(nil) _, resp = th.SystemAdminClient.UpdateChannelScheme(channel.Id, channelScheme.Id) CheckNotImplementedStatus(t, resp) diff --git a/api4/team.go b/api4/team.go index b7e5f76bab..d15cb25ea7 100644 --- a/api4/team.go +++ b/api4/team.go @@ -986,7 +986,7 @@ func inviteUsersToTeam(c *Context, w http.ResponseWriter, r *http.Request) { c.Err = err return } - // in graceful mode we return both the succesful ones and the failed ones + // in graceful mode we return both the successful ones and the failed ones w.Write([]byte(model.EmailInviteWithErrorToJson(invitesWithError))) } else { err := c.App.InviteNewUsersToTeam(emailList, c.Params.TeamId, c.App.Session().UserId) @@ -1035,7 +1035,7 @@ func inviteGuestsToChannels(c *Context, w http.ResponseWriter, r *http.Request) c.Err = err return } - // in graceful mode we return both the succesful ones and the failed ones + // in graceful mode we return both the successful ones and the failed ones w.Write([]byte(model.EmailInviteWithErrorToJson(invitesWithError))) } else { err := c.App.InviteGuestsToChannels(c.Params.TeamId, guestsInvite, c.App.Session().UserId) diff --git a/api4/user_test.go b/api4/user_test.go index 9a158d66a6..bdf1abebad 100644 --- a/api4/user_test.go +++ b/api4/user_test.go @@ -2483,7 +2483,7 @@ func TestRevokeSessions(t *testing.T) { CheckBadRequestStatus(t, resp) status, resp := th.Client.RevokeSession(user.Id, session.Id) - require.True(t, status, "user session revoke successfuly") + require.True(t, status, "user session revoke successfully") CheckNoError(t, resp) th.LoginBasic() diff --git a/app/notification.go b/app/notification.go index 194a7d9068..ff2d4ca656 100644 --- a/app/notification.go +++ b/app/notification.go @@ -703,7 +703,7 @@ type PostNotification struct { } // Returns the name of the channel for this notification. For direct messages, this is the sender's name -// preceeded by an at sign. For group messages, this is a comma-separated list of the members of the +// preceded by an at sign. For group messages, this is a comma-separated list of the members of the // channel, with an option to exclude the recipient of the message from that list. func (n *PostNotification) GetChannelName(userNameFormat, excludeId string) string { switch n.Channel.Type { diff --git a/app/notification_test.go b/app/notification_test.go index a2a5d72224..6e3f9fc521 100644 --- a/app/notification_test.go +++ b/app/notification_test.go @@ -247,7 +247,7 @@ func TestFilterOutOfChannelMentions(t *testing.T) { assert.Nil(t, outOfGroupUsers) }) - t.Run("should not return results for non-existant users", func(t *testing.T) { + t.Run("should not return results for non-existent users", func(t *testing.T) { post := &model.Post{} potentialMentions := []string{"foo", "bar"} diff --git a/app/plugin_api_test.go b/app/plugin_api_test.go index a4be3ac20e..737afbf5a7 100644 --- a/app/plugin_api_test.go +++ b/app/plugin_api_test.go @@ -919,7 +919,7 @@ func pluginAPIHookTest(t *testing.T, th *TestHelper, fileName string, id string, // 2. For each folder - compiles the main.go inside and executes it, validating it's result // 3. If folder starts with "manual." it is skipped ("manual." tests executed in other part of this file) // 4. Before compiling the main.go file is passed through templating and the following values are available in the template: BasicUser, BasicUser2, BasicChannel, BasicTeam, BasicPost -// 5. Succesfully running test should return nil, "OK". Any other returned string is considered and error +// 5. Successfully running test should return nil, "OK". Any other returned string is considered and error func TestBasicAPIPlugins(t *testing.T) { defaultSchema := getDefaultPluginSettingsSchema() diff --git a/app/plugin_requests.go b/app/plugin_requests.go index b78673103e..3c4591d61c 100644 --- a/app/plugin_requests.go +++ b/app/plugin_requests.go @@ -45,7 +45,7 @@ func (a *App) ServePluginRequest(w http.ResponseWriter, r *http.Request) { func (a *App) ServeInterPluginRequest(w http.ResponseWriter, r *http.Request, sourcePluginId, destinationPluginId string) { pluginsEnvironment := a.GetPluginsEnvironment() if pluginsEnvironment == nil { - err := model.NewAppError("ServeInterPluginRequest", "app.plugin.disabled.app_error", nil, "Plugin enviroment not found.", http.StatusNotImplemented) + err := model.NewAppError("ServeInterPluginRequest", "app.plugin.disabled.app_error", nil, "Plugin environment not found.", http.StatusNotImplemented) a.Log().Error(err.Error()) w.WriteHeader(err.StatusCode) w.Header().Set("Content-Type", "application/json") diff --git a/app/post_metadata.go b/app/post_metadata.go index 3610d75ebe..3a99d29bd4 100644 --- a/app/post_metadata.go +++ b/app/post_metadata.go @@ -72,7 +72,7 @@ func (a *App) OverrideIconURLIfEmoji(post *model.Post) { if emojiUrl, err := a.GetEmojiStaticUrl(emojiName); err == nil { post.AddProp(model.POST_PROPS_OVERRIDE_ICON_URL, emojiUrl) } else { - mlog.Warn("Failed to retrieve URL for overriden profile icon (emoji)", mlog.String("emojiName", emojiName), mlog.Err(err)) + mlog.Warn("Failed to retrieve URL for overridden profile icon (emoji)", mlog.String("emojiName", emojiName), mlog.Err(err)) } } diff --git a/app/syncables.go b/app/syncables.go index 631e92a722..095285f465 100644 --- a/app/syncables.go +++ b/app/syncables.go @@ -123,7 +123,7 @@ func (a *App) DeleteGroupConstrainedMemberships() error { // deleteGroupConstrainedTeamMemberships deletes team memberships of users who aren't members of the allowed // groups of the given group-constrained team. If a teamID is given then the procedure is scoped to the given team, -// if teamID is nil then the proceedure affects all teams. +// if teamID is nil then the procedure affects all teams. func (a *App) deleteGroupConstrainedTeamMemberships(teamID *string) error { teamMembers, appErr := a.TeamMembersToRemove(teamID) if appErr != nil { @@ -147,7 +147,7 @@ func (a *App) deleteGroupConstrainedTeamMemberships(teamID *string) error { // deleteGroupConstrainedChannelMemberships deletes channel memberships of users who aren't members of the allowed // groups of the given group-constrained channel. If a channelID is given then the procedure is scoped to the given team, -// if channelID is nil then the proceedure affects all teams. +// if channelID is nil then the procedure affects all teams. func (a *App) deleteGroupConstrainedChannelMemberships(channelID *string) error { channelMembers, appErr := a.ChannelMembersToRemove(channelID) if appErr != nil { diff --git a/cmd/mattermost/commands/team_test.go b/cmd/mattermost/commands/team_test.go index 9c3b5c48ba..ac7a9f0472 100644 --- a/cmd/mattermost/commands/team_test.go +++ b/cmd/mattermost/commands/team_test.go @@ -209,7 +209,7 @@ func TestRenameTeam(t *testing.T) { th.CheckCommand(t, "team", "rename", team2.Name, newTeamName, "--display_name", newDisplayName) - // No renaming should have occured + // No renaming should have occurred require.Equal(t, team2.Name, n, "team was renamed when it should have not been") require.Equal(t, team2.DisplayName, dn, "team display name was changed when it should have not been") diff --git a/cmd/mattermost/commands/user.go b/cmd/mattermost/commands/user.go index cc5c197966..fe19d51377 100644 --- a/cmd/mattermost/commands/user.go +++ b/cmd/mattermost/commands/user.go @@ -373,7 +373,7 @@ func userCreateCmdF(command *cobra.Command, args []string) error { } } else { // This else case exists to prevent the first user created from being - // created as a system admin unless explicity specified. + // created as a system admin unless explicitly specified. if _, err := a.UpdateUserRoles(ruser.Id, "system_user", false); err != nil { return errors.New("If this is the first user: Unable to prevent user from being system admin. Error: " + err.Error()) } diff --git a/cmd/mattermost/commands/webhook_test.go b/cmd/mattermost/commands/webhook_test.go index 339e62c24b..0729fde7de 100644 --- a/cmd/mattermost/commands/webhook_test.go +++ b/cmd/mattermost/commands/webhook_test.go @@ -291,7 +291,7 @@ func TestCreateOutgoingWebhook(t *testing.T) { th.CheckCommand(t, "webhook", "create-outgoing", "--team", team, "--channel", th.BasicChannel.Id, "--display-name", displayName, "--trigger-word", triggerWord1, "--trigger-word", triggerWord2, "--url", callbackURL1, "--url", callbackURL2, "--user", user) webhooks, err := th.App.GetOutgoingWebhooksPage(0, 1000) - require.Nil(t, err, "Unable to retreive outgoing webhooks") + require.Nil(t, err, "Unable to retrieve outgoing webhooks") found := false for _, webhook := range webhooks { diff --git a/config/database.go b/config/database.go index cfb42e0319..d5f4764be1 100644 --- a/config/database.go +++ b/config/database.go @@ -102,7 +102,7 @@ func initializeConfigurationsTable(db *sqlx.DB) error { // Change from TEXT (65535 limit) to MEDIUM TEXT (16777215) on MySQL. This is a // backwards-compatible migration for any existing schema. - // Also fix using the wrong encoding initally + // Also fix using the wrong encoding initially if db.DriverName() == "mysql" { _, err = db.Exec(`ALTER TABLE Configurations MODIFY Value MEDIUMTEXT`) if err != nil { diff --git a/services/filesstore/filesstore_test.go b/services/filesstore/filesstore_test.go index 35bdf119c8..d25cb5e243 100644 --- a/services/filesstore/filesstore_test.go +++ b/services/filesstore/filesstore_test.go @@ -27,7 +27,7 @@ type FileBackendTestSuite struct { func TestLocalFileBackendTestSuite(t *testing.T) { // Setup a global logger to catch tests logging outside of app context - // The global logger will be stomped by apps initalizing but that's fine for testing. Ideally this won't happen. + // The global logger will be stomped by apps initializing but that's fine for testing. Ideally this won't happen. mlog.InitGlobalLogger(mlog.NewLogger(&mlog.LoggerConfiguration{ EnableConsole: true, ConsoleJson: true, diff --git a/store/sqlstore/user_store.go b/store/sqlstore/user_store.go index 12be483252..db1bb65cd1 100644 --- a/store/sqlstore/user_store.go +++ b/store/sqlstore/user_store.go @@ -1021,7 +1021,7 @@ func (us SqlUserStore) Count(options model.UserCountOptions) (int64, *model.AppE } else { query = query.LeftJoin("Bots ON u.Id = Bots.UserId").Where("Bots.UserId IS NULL") if options.ExcludeRegularUsers { - // Currenty this doesn't make sense because it will always return 0 + // Currently this doesn't make sense because it will always return 0 return int64(0), model.NewAppError("SqlUserStore.Count", "store.sql_user.count.app_error", nil, "", http.StatusInternalServerError) } } diff --git a/testlib/helper.go b/testlib/helper.go index 401b16407e..47bc79abbd 100644 --- a/testlib/helper.go +++ b/testlib/helper.go @@ -45,7 +45,7 @@ func NewMainHelperWithOptions(options *HelperOptions) *MainHelper { flag.Parse() // Setup a global logger to catch tests logging outside of app context - // The global logger will be stomped by apps initalizing but that's fine for testing. + // The global logger will be stomped by apps initializing but that's fine for testing. // Ideally this won't happen. mlog.InitGlobalLogger(mlog.NewLogger(&mlog.LoggerConfiguration{ EnableConsole: true,