Skip to content

Commit

Permalink
Tweak uniformity of expression was implemented
Browse files Browse the repository at this point in the history
Use "behaviour" instead of "behavior"
  • Loading branch information
ydah authored and bbatsov committed May 6, 2022
1 parent 914551a commit 5b7c91b
Show file tree
Hide file tree
Showing 20 changed files with 24 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Expand Up @@ -98,6 +98,9 @@ Metrics/ModuleLength:

Naming/InclusiveLanguage:
FlaggedTerms:
behaviour:
Suggestions:
- behavior
offence:
Suggestions:
- offense
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Expand Up @@ -11,4 +11,4 @@ patches, commit comments, etc.).
* Participants will be tolerant of opposing views.
* Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
* When interpreting the words and actions of others, participants should always assume good intentions.
* Behaviour which can be reasonably considered harassment will not be tolerated.
* Behavior which can be reasonably considered harassment will not be tolerated.
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/usage/auto_correct.adoc
Expand Up @@ -15,7 +15,7 @@ There are a couple of things to keep in mind about auto-correct:
- Some automatic corrections that _are_ possible have not been implemented yet.
- Some automatic corrections might change (slightly) the semantics of the code,
meaning they'd produce code that's mostly equivalent to the original code, but
not 100% equivalent. We call such auto-correct behaviour "unsafe".
not 100% equivalent. We call such auto-correct behavior "unsafe".
TIP: You should always run your test suite after using the auto-correct functionality.

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/usage/basic_usage.adoc
Expand Up @@ -82,7 +82,7 @@ TIP: See xref:usage/auto_correct.adoc[Auto-correct] for more details.
RuboCop comes with a preconfigured set of rules for each of its cops, based on the https://rubystyle.guide[Ruby Style Guide].
Depending on your project, you may wish to reconfigure a cop, tell to ignore certain files, or disable it altogether.

The most common way to change RuboCop's behaviour is to create a configuration file named `.rubocop.yml` in the
The most common way to change RuboCop's behavior is to create a configuration file named `.rubocop.yml` in the
project's root directory.

For more information, see xref:configuration.adoc[Configuration].
Expand Down
4 changes: 2 additions & 2 deletions lib/rubocop/cop/lint/ambiguous_range.rb
Expand Up @@ -5,7 +5,7 @@ module Cop
module Lint
# This cop checks for ambiguous ranges.
#
# Ranges have quite low precedence, which leads to unexpected behaviour when
# Ranges have quite low precedence, which leads to unexpected behavior when
# using a range with other operators. This cop avoids that by making ranges
# explicit by requiring parenthesis around complex range boundaries (anything
# that is not a literal: numerics, strings, symbols, etc.).
Expand All @@ -21,7 +21,7 @@ module Lint
# The cop auto-corrects by wrapping the entire boundary in parentheses, which
# makes the outcome more explicit but is possible to not be the intention of the
# programmer. For this reason, this cop's auto-correct is unsafe (it will not
# change the behaviour of the code, but will not necessarily match the
# change the behavior of the code, but will not necessarily match the
# intent of the program).
#
# @example
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/lint/loop.rb
Expand Up @@ -6,7 +6,7 @@ module Lint
# This cop checks for uses of `begin...end while/until something`.
#
# @safety
# The cop is unsafe because behaviour can change in some cases, including
# The cop is unsafe because behavior can change in some cases, including
# if a local variable inside the loop body is accessed outside of it, or if the
# loop body raises a `StopIteration` exception (which `Kernel#loop` rescues).
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/lint/non_deterministic_require_order.rb
Expand Up @@ -18,7 +18,7 @@ module Lint
#
# @safety
# This cop is unsafe in the case where sorting files changes existing
# expected behaviour.
# expected behavior.
#
# @example
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/lint/or_assignment_to_constant.rb
Expand Up @@ -11,7 +11,7 @@ module Lint
#
# @safety
# This cop is unsafe because code that is already conditionally
# assigning a constant may have its behaviour changed by
# assigning a constant may have its behavior changed by
# auto-correction.
#
# @example
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/lint/raise_exception.rb
Expand Up @@ -15,7 +15,7 @@ module Lint
#
# @safety
# This cop is unsafe because it will change the exception class being
# raised, which is a change in behaviour.
# raised, which is a change in behavior.
#
# @example
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/security/yaml_load.rb
Expand Up @@ -10,7 +10,7 @@ module Security
# NOTE: Ruby 3.1+ (Psych 4) uses `Psych.load` as `Psych.safe_load` by default.
#
# @safety
# The behaviour of the code might change depending on what was
# The behavior of the code might change depending on what was
# in the YAML payload, since `YAML.safe_load` is more restrictive.
#
# @example
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/and_or.rb
Expand Up @@ -10,7 +10,7 @@ module Style
# @safety
# Auto-correction is unsafe because there is a different operator precedence
# between logical operators (`&&` and `||`) and semantic operators (`and` and `or`),
# and that might change the behaviour.
# and that might change the behavior.
#
# @example EnforcedStyle: always
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/case_like_if.rb
Expand Up @@ -9,7 +9,7 @@ module Style
# @safety
# This cop is unsafe. `case` statements use `===` for equality,
# so if the original conditional used a different equality operator, the
# behaviour may be different.
# behavior may be different.
#
# @example
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/date_time.rb
Expand Up @@ -11,7 +11,7 @@ module Style
#
# @safety
# Autocorrection is not safe, because `DateTime` and `Time` do not have
# exactly the same behaviour, although in most cases the autocorrection
# exactly the same behavior, although in most cases the autocorrection
# will be fine.
#
# @example
Expand Down
4 changes: 2 additions & 2 deletions lib/rubocop/cop/style/identical_conditional_branches.rb
Expand Up @@ -13,7 +13,7 @@ module Style
#
# @safety
# Auto-correction is unsafe because changing the order of method invocations
# may change the behaviour of the code. For example:
# may change the behavior of the code. For example:
#
# [source,ruby]
# ----
Expand All @@ -27,7 +27,7 @@ module Style
# ----
#
# In this example, `method_that_relies_on_global_state` will be moved before
# `method_that_modifies_global_state`, which changes the behaviour of the program.
# `method_that_modifies_global_state`, which changes the behavior of the program.
#
# @example
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/optional_arguments.rb
Expand Up @@ -8,7 +8,7 @@ module Style
#
# @safety
# This cop is unsafe because changing a method signature will
# implicitly change behaviour.
# implicitly change behavior.
#
# @example
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/optional_boolean_parameter.rb
Expand Up @@ -9,7 +9,7 @@ module Style
#
# @safety
# This cop is unsafe because changing a method signature will
# implicitly change behaviour.
# implicitly change behavior.
#
# @example
# # bad
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/redundant_regexp_character_class.rb
Expand Up @@ -99,7 +99,7 @@ def whitespace_in_free_space_mode?(node, elem)
end

def backslash_b?(elem)
# \b's behaviour is different inside and outside of a character class, matching word
# \b's behavior is different inside and outside of a character class, matching word
# boundaries outside but backspace (0x08) when inside.
elem == '\b'
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/redundant_regexp_escape.rb
Expand Up @@ -59,7 +59,7 @@ def on_regexp(node)
def allowed_escape?(node, char, within_character_class)
# Strictly speaking a few single-letter metachars are currently
# unnecessary to "escape", e.g. i, E, F, but enumerating them is
# rather difficult, and their behaviour could change over time with
# rather difficult, and their behavior could change over time with
# different versions of Ruby so that e.g. /\i/ != /i/
return true if /[[:alnum:]]/.match?(char)
return true if ALLOWED_ALWAYS_ESCAPES.include?(char) || delimiter?(node, char)
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/safe_navigation.rb
Expand Up @@ -23,7 +23,7 @@ module Style
#
# @safety
# Autocorrection is unsafe because if a value is `false`, the resulting
# code will have different behaviour or raise an error.
# code will have different behavior or raise an error.
#
# [source,ruby]
# ----
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/string_chars.rb
Expand Up @@ -8,7 +8,7 @@ module Style
# @safety
# This cop is unsafe because it cannot be guaranteed that the receiver
# is actually a string. If another class has a `split` method with
# different behaviour, it would be registered as a false positive.
# different behavior, it would be registered as a false positive.
#
# @example
# # bad
Expand Down

0 comments on commit 5b7c91b

Please sign in to comment.