Skip to content

Commit

Permalink
Merge pull request rubocop#13399 from dvandersluis/fix-and-offense-typo
Browse files Browse the repository at this point in the history
Fix typos `and offense` instead of `an offense`
  • Loading branch information
koic authored Oct 29, 2024
2 parents 8a72c08 + 1f58513 commit 3e855b0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ Naming/InclusiveLanguage:
' a offense':
Suggestions:
- an offense
' and offense':
Suggestions:
- ' an offense'
auto-correct:
Suggestions:
- autocorrect
Expand Down
8 changes: 4 additions & 4 deletions spec/rubocop/cli/autocorrect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2132,7 +2132,7 @@ def self.some_method(foo, bar: 1)
RUBY
end

it 'corrects `Lint/AmbiguousRange` and offenses and accepts Style/RedundantParentheses' do
it 'corrects `Lint/AmbiguousRange` offenses and accepts Style/RedundantParentheses' do
create_file('example.rb', <<~RUBY)
x...(y || z)
RUBY
Expand All @@ -2144,7 +2144,7 @@ def self.some_method(foo, bar: 1)
RUBY
end

it 'corrects Lint/ParenthesesAsGroupedExpression and offenses and ' \
it 'corrects Lint/ParenthesesAsGroupedExpression offenses and ' \
'accepts Style/RedundantParentheses' do
create_file('example.rb', <<~RUBY)
do_something (argument)
Expand Down Expand Up @@ -2184,7 +2184,7 @@ def self.some_method(foo, bar: 1)
special_for_inner_method_call
special_for_inner_method_call_in_parentheses
].each do |style|
it 'does not crash `Layout/ArgumentAlignment` and offenses and accepts `Layout/FirstArgumentIndentation` ' \
it 'does not crash `Layout/ArgumentAlignment` and accepts `Layout/FirstArgumentIndentation` ' \
'when specifying `EnforcedStyle: with_fixed_indentation` of `Layout/ArgumentAlignment` ' \
"and `EnforcedStyle: #{style}` of `Layout/FirstArgumentIndentation`" do
create_file('example.rb', <<~RUBY)
Expand Down Expand Up @@ -2550,7 +2550,7 @@ def do_even_more_stuff
RUBY
end

it 'does not crash Lint/SafeNavigationWithEmpty and offenses and accepts Style/SafeNavigation ' \
it 'does not crash Lint/SafeNavigationWithEmpty and accepts Style/SafeNavigation ' \
'when checking `foo&.empty?` in a conditional' do
create_file('example.rb', <<~RUBY)
do_something if ENV['VERSION'] && ENV['VERSION'].empty?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
end

context 'array nested in a method call' do
it 'registers an corrects the offense' do
it 'registers and corrects the offense' do
expect_offense(<<~RUBY)
method([:foo,
^^^^ Add a line break before the first element of a multi-line array.
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/lint/duplicate_methods_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ def foo
RUBY
end

it 'properly registers and offense when deeply nested' do
it 'properly registers an offense when deeply nested' do
expect_offense(<<~RUBY, 'test.rb')
module A
module B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def foo = true
end
end

it "registers and offense and corrects an endless method followed by `#{operator}`" do
it "registers an offense and corrects an endless method followed by `#{operator}`" do
expect_offense(<<~RUBY, operator: operator)
def foo = true #{operator} bar
^^^^^^^^^^^^^^^^{operator}^^^^ Avoid using `#{operator}` statements with endless methods.
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/style/class_and_module_children_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class Foo::Bar::Baz
RUBY
end

it 'registers and offense for deeply nested children' do
it 'registers an offense for deeply nested children' do
expect_offense(<<~RUBY)
class Foo
^^^ Use compact module/class definition instead of nested style.
Expand Down

0 comments on commit 3e855b0

Please sign in to comment.