DEV: Correct typos and spelling mistakes (#12812)

Over the years we accrued many spelling mistakes in the code base. 

This PR attempts to fix spelling mistakes and typos in all areas of the code that are extremely safe to change 

- comments
- test descriptions
- other low risk areas
This commit is contained in:
Josh Soref
2021-05-21 11:43:47 +10:00
committed by GitHub
parent 6421fabb02
commit 59097b207f
207 changed files with 315 additions and 315 deletions
+1 -1
View File
@@ -227,7 +227,7 @@ class Autospec::Manager
file, line = line.split(' ')
file = reverse_symlink(file)
file = file.sub(Rails.root.to_s + "/", "")
# process_change can aquire a mutex and block
# process_change can acquire a mutex and block
# the acceptor
Thread.new do
if file =~ /(es6|js)$/
+1 -1
View File
@@ -23,7 +23,7 @@ module Autospec
command = begin
line_specified = specs.split.any? { |s| s =~ /\:/ } # Parallel spec can't run specific line
multiple_files = specs.split.count > 1 || specs == "spec" # Only paralellize multiple files
multiple_files = specs.split.count > 1 || specs == "spec" # Only parallelize multiple files
if ENV["PARALLEL_SPEC"] == '1' && multiple_files && !line_specified
"bin/turbo_rspec #{args.join(" ")} #{specs.split.join(" ")}"
else
+1 -1
View File
@@ -93,7 +93,7 @@ module BadgeQueries
JOIN post_actions pa1 on pa1.id = x.id
SQL
# Incorrect, but good enough - (earlies post edited vs first edit)
# Incorrect, but good enough - (earliest post edited vs first edit)
Editor = <<~SQL
SELECT p.user_id, min(p.id) post_id, min(p.created_at) granted_at
FROM badge_posts p
+1 -1
View File
@@ -14,7 +14,7 @@ module Base62
str = ""
while num > 0
# prepend base62 charaters
# prepend base62 characters
str = KEYS[num % BASE] + str
num = num / BASE
end
+1 -1
View File
@@ -32,7 +32,7 @@ module DiscourseTagging
# tag names which are visible, but not usable, by *some users*
readonly_tags = DiscourseTagging.readonly_tag_names(guardian)
# tags names which are not visibile or usuable by this user
# tags names which are not visible or usable by this user
hidden_tags = DiscourseTagging.hidden_tag_names(guardian)
# tag names which ARE permitted by *this user*
+1 -1
View File
@@ -93,7 +93,7 @@ module FileStore
begin
parsed_url = URI.parse(UrlHelper.encode(url))
rescue
# There are many exceptions possible here including Addressable::URI:: excpetions
# There are many exceptions possible here including Addressable::URI:: exceptions
# and URI:: exceptions, catch all may seem wide, but it makes no sense to raise ever
# on an invalid url here
return false
@@ -19,7 +19,7 @@ module ActiveRecord
BLANK_ARRAY = [].freeze
# this patch just allows everyting in Rails 6
# this patch just allows everything in Rails 6
def disallow_raw_sql!(args, permit: nil)
# we may consider moving to https://github.com/rails/rails/pull/33330
# once all frozen string hints are in place
+1 -1
View File
@@ -1,6 +1,6 @@
# frozen_string_literal: true
#mixin for all guardian methods dealing with category permisions
#mixin for all guardian methods dealing with category permissions
module CategoryGuardian
# Creating Method
+1 -1
View File
@@ -1,6 +1,6 @@
# frozen_string_literal: true
#mixin for all guardian methods dealing with tagging permisions
#mixin for all guardian methods dealing with tagging permissions
module TagGuardian
def can_create_tag?
return is_admin? if SiteSetting.min_trust_to_create_tag.to_s == 'admin'
+1 -1
View File
@@ -1,6 +1,6 @@
# frozen_string_literal: true
#mixin for all guardian methods dealing with topic permisions
#mixin for all guardian methods dealing with topic permissions
module TopicGuardian
def can_remove_allowed_users?(topic, target_user = nil)
+1 -1
View File
@@ -42,7 +42,7 @@ module Imap
if @status[:uid_validity] != @group.imap_uid_validity
# If UID validity changes, the whole mailbox must be synchronized (all
# emails are considered new and will be associated to existent topics
# in Email::Reciever by matching Message-Ids).
# in Email::Receiver by matching Message-Ids).
ImapSyncLog.warn("UIDVALIDITY = #{@status[:uid_validity]} does not match expected #{@group.imap_uid_validity}, invalidating IMAP cache and resyncing emails for mailbox #{@group.imap_mailbox_name}", @group)
@group.imap_last_uid = 0
end
+2 -2
View File
@@ -10,7 +10,7 @@
*/
(function ( root ) {
// Create the contructor function
// Create the constructor function
function MessageFormat ( locale, pluralFunc ) {
var fallbackLocale;
@@ -133,7 +133,7 @@
var result = {
/*
* Parses the input with a generated parser. If the parsing is successfull,
* Parses the input with a generated parser. If the parsing is successful,
* returns a value explicitly or implicitly specified by the grammar from
* which the parser was generated (see |PEG.buildParser|). If the parsing is
* unsuccessful, throws |PEG.parser.SyntaxError| describing the error.
+1 -1
View File
@@ -125,7 +125,7 @@ function mustacheValue(node, state) {
return `${useHelper(state, "iconNode")}(${valueOf(node.params[0])})`;
break;
default:
// Shortcut: If our mustach has hash arguments, we can assume it's attaching.
// Shortcut: If our mustache has hash arguments, we can assume it's attaching.
// For example `{{home-logo count=123}}` can become `this.attach('home-logo, { "count": 123 });`
let hash = node.hash;
if (hash.pairs.length) {
+1 -1
View File
@@ -242,7 +242,7 @@ module JsLocaleHelper
return locale_data if locale_data
end
# English should alyways work
# English should always work
["en", File.join(path, "en.js")] if fallback_to_english
end
+1 -1
View File
@@ -121,7 +121,7 @@ class LetterAvatar
end
end
# palette of optimally disctinct colors
# palette of optimally distinct colors
# cf. http://tools.medialab.sciences-po.fr/iwanthue/index.php
# parameters used:
# - H: 0 - 360
+1 -1
View File
@@ -10,7 +10,7 @@ module Middleware
# enforces hostname to match the hostname of our connection
# this middleware lives after rails multisite so at this point
# Discourse.current_hostname MUST be canonical, enforce it so
# all Rails helpers are guarenteed to use it unconditionally and
# all Rails helpers are guaranteed to use it unconditionally and
# never generate incorrect links
env[Rack::Request::HTTP_X_FORWARDED_HOST] = nil
+1 -1
View File
@@ -1,6 +1,6 @@
# frozen_string_literal: true
# Note: This logic was originaly extracted from the Pbkdf2 gem to fix Ruby 2.0
# Note: This logic was originally extracted from the Pbkdf2 gem to fix Ruby 2.0
# issues, but that gem has gone stale so we won't be returning to it.
require 'openssl'
+2 -2
View File
@@ -591,7 +591,7 @@ class Plugin::Instance
end
end
# note, we need to be able to parse seperately to activation.
# note, we need to be able to parse separately to activation.
# this allows us to present information about a plugin in the UI
# prior to activations
def activate!
@@ -816,7 +816,7 @@ class Plugin::Instance
end
# Register a new UserApiKey scope, and its allowed routes. Scope will be prefixed
# with the (parametetized) plugin name followed by a colon.
# with the (parameterized) plugin name followed by a colon.
#
# For example, if discourse-awesome-plugin registered this:
#
+1 -1
View File
@@ -127,7 +127,7 @@ class PostActionCreator
end
rescue ActiveRecord::RecordNotUnique
# If the user already performed this action, it's proably due to a different browser tab
# If the user already performed this action, it's probably due to a different browser tab
# or non-debounced clicking. We can ignore.
result.success = true
result.post_action = PostAction.find_by(
+1 -1
View File
@@ -32,7 +32,7 @@ class PostCreator
# skip_jobs - Don't enqueue jobs when creation succeeds. This is needed if you
# wrap `PostCreator` in a transaction, as the sidekiq jobs could
# dequeue before the commit finishes. If you do this, be sure to
# call `enqueue_jobs` after the transaction is comitted.
# call `enqueue_jobs` after the transaction is committed.
# hidden_reason_id - Reason for hiding the post (optional)
# skip_validations - Do not validate any of the content in the post
# draft_key - the key of the draft we are creating (will be deleted on success)
+1 -1
View File
@@ -10,7 +10,7 @@ class PostJobsEnqueuer
def enqueue_jobs
# We need to enqueue jobs after the transaction.
# Otherwise they might begin before the data has been comitted.
# Otherwise they might begin before the data has been committed.
enqueue_post_alerts unless @opts[:import_mode]
feature_topic_users unless @opts[:import_mode]
trigger_post_post_process
+1 -1
View File
@@ -187,7 +187,7 @@ class RateLimiter
# number of events in buffer less than max allowed? OR
(redis.llen(prefixed_key) < @max) ||
# age bigger than silding window size?
# age bigger than sliding window size?
(age_of_oldest(now) >= @secs)
end
+1 -1
View File
@@ -76,7 +76,7 @@ class Search
data.force_encoding("UTF-8")
if purpose != :topic
# TODO cppjieba_rb is designed for chinese, we need something else for Japanese
# Korean appears to be safe cause words are already space seperated
# Korean appears to be safe cause words are already space separated
# For Japanese we should investigate using kakasi
if segment_cjk?
require 'cppjieba_rb' unless defined? CppjiebaRb
+1 -1
View File
@@ -39,7 +39,7 @@ task "admin:create" => :environment do
email = ask("Email: ")
existing_user = User.find_by_email(email)
# check if user account already exixts
# check if user account already exists
if existing_user
# user already exists, ask for password reset
admin = existing_user
+1 -1
View File
@@ -1,7 +1,7 @@
# frozen_string_literal: true
# I like guard, don't get me wrong, but it is just not working right
# architectually it can not do what I want it to do, this is how I want
# architecturally it can not do what I want it to do, this is how I want
# it to behave
desc "Run all specs automatically as needed"
+1 -1
View File
@@ -8,7 +8,7 @@
# => SKIP_TESTS set to 1 to skip all tests
# => SKIP_CORE set to 1 to skip core tests (rspec and qunit)
# => SKIP_PLUGINS set to 1 to skip plugin tests (rspec and qunit)
# => SKIP_INSTALL_PLUGINS comma seperated list of plugins you want to skip installing
# => SKIP_INSTALL_PLUGINS comma separated list of plugins you want to skip installing
# => INSTALL_OFFICIAL_PLUGINS set to 1 to install all core plugins before running tests
# => RUBY_ONLY set to 1 to skip all qunit tests
# => JS_ONLY set to 1 to skip all rspec tests
+1 -1
View File
@@ -111,7 +111,7 @@ task 'emails:test', [:email] => [:environment] do |_, args|
STR
elsif e.to_s.match(/530.*STARTTLS/)
# We can't run a prelimary test with STARTTLS, we'll just try sending the test email.
# We can't run a preliminary test with STARTTLS, we'll just try sending the test email.
message = "OK"
elsif e.to_s.match(/535/)
+1 -1
View File
@@ -46,7 +46,7 @@ def gather_uploads
`cp --link '#{source}' '#{destination}'`
end
# ensure file has been succesfuly copied over
# ensure file has been successfully copied over
raise unless file_exists?(destination)
# remap links in db
+1 -1
View File
@@ -4,7 +4,7 @@
# Clean up a text
#
# Whe use ActiveSupport mb_chars from here to properly support non ascii downcase
# We use ActiveSupport mb_chars from here to properly support non ascii downcase
require 'active_support/core_ext/string/multibyte'
class TextCleaner
+1 -1
View File
@@ -1,6 +1,6 @@
# frozen_string_literal: true
# Whe use ActiveSupport mb_chars from here to properly support non ascii downcase
# We use ActiveSupport mb_chars from here to properly support non ascii downcase
# TODO remove when ruby 2.4 lands
require 'active_support/core_ext/string/multibyte'
+2 -2
View File
@@ -14,7 +14,7 @@ module TopicQuerySQL
-"CASE WHEN categories.id = #{SiteSetting.uncategorized_category_id.to_i} THEN '' ELSE categories.name END #{dir}"
end
# If you've clearned the pin, use bumped_at, otherwise put it at the top
# If you've cleared the pin, use bumped_at, otherwise put it at the top
def order_with_pinned_sql
-"CASE
WHEN (COALESCE(topics.pinned_at, '#{lowest_date}') > COALESCE(tu.cleared_pinned_at, '#{lowest_date}'))
@@ -23,7 +23,7 @@ module TopicQuerySQL
END DESC"
end
# If you've clearned the pin, use bumped_at, otherwise put it at the top
# If you've cleared the pin, use bumped_at, otherwise put it at the top
def order_nocategory_with_pinned_sql
-"CASE
WHEN topics.pinned_globally
+1 -1
View File
@@ -87,7 +87,7 @@ class UrlHelper
# to avoid asset_host mixups
return schemaless(url) if secure
# PERF: avoid parsing url excpet for extreme conditions
# PERF: avoid parsing url except for extreme conditions
# this is a hot path used on home page
filename = url
if url.include?("?")