Skip to content

Commit b671caa

Browse files
committed
Suppress RuboCop offenses
Follow up rubocop/rubocop#10717 and suppresses the following offenses: ```console Offenses: lib/rubocop/cop/rails/enum_hash.rb:23:80: C: [Corrected] Layout/LineContinuationSpacing: Use one space in front of backslash. MSG = 'Enum defined as an array found in `%<enum>s` enum declaration. '\ ^ lib/rubocop/cop/rails/order_by_id.rb:26:58: C: [Corrected] Layout/LineContinuationSpacing: Use one space in front of backslash. MSG = 'Do not use the `id` column for ordering. '\ ^ spec/rubocop/cop/rails/schema_comment_spec.rb:39:77: C: [Corrected] Layout/LineContinuationSpacing: Use one space in front of backslash. it 'does not register an offense when `add_column` has `comment` option'\ ^ spec/rubocop/cop/rails/schema_comment_spec.rb:108:76: C: [Corrected] Layout/LineContinuationSpacing: Use one space in front of backslash. it 'does not register an offense when `t.integer` has `comment` option'\ ^ ```
1 parent 5f38b74 commit b671caa

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

lib/rubocop/cop/rails/enum_hash.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ module Rails
2020
class EnumHash < Base
2121
extend AutoCorrector
2222

23-
MSG = 'Enum defined as an array found in `%<enum>s` enum declaration. '\
24-
'Use hash syntax instead.'
23+
MSG = 'Enum defined as an array found in `%<enum>s` enum declaration. Use hash syntax instead.'
2524
RESTRICT_ON_SEND = %i[enum].freeze
2625

2726
def_node_matcher :enum?, <<~PATTERN

lib/rubocop/cop/rails/order_by_id.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ module Rails
2323
class OrderById < Base
2424
include RangeHelp
2525

26-
MSG = 'Do not use the `id` column for ordering. '\
27-
'Use a timestamp column to order chronologically.'
26+
MSG = 'Do not use the `id` column for ordering. Use a timestamp column to order chronologically.'
2827
RESTRICT_ON_SEND = %i[order].freeze
2928

3029
def_node_matcher :order_by_id?, <<~PATTERN

spec/rubocop/cop/rails/schema_comment_spec.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
RUBY
3737
end
3838

39-
it 'does not register an offense when `add_column` has `comment` option'\
40-
'among other options' do
39+
it 'does not register an offense when `add_column` has `comment` option among other options' do
4140
expect_no_offenses(<<~RUBY)
4241
add_column :table, :column, :integer, null: false, comment: 'An integer field', default: 0
4342
RUBY
@@ -96,17 +95,15 @@
9695
RUBY
9796
end
9897

99-
it 'does not register an offense when `t.column` has `comment` option' \
100-
'among other options' do
98+
it 'does not register an offense when `t.column` has `comment` option among other options' do
10199
expect_no_offenses(<<~RUBY)
102100
create_table :users, comment: 'Table' do |t|
103101
t.column :column, :integer, default: nil, comment: 'I am a column', null: true
104102
end
105103
RUBY
106104
end
107105

108-
it 'does not register an offense when `t.integer` has `comment` option'\
109-
'among other options' do
106+
it 'does not register an offense when `t.integer` has `comment` option among other options' do
110107
expect_no_offenses(<<~RUBY)
111108
create_table :users, comment: 'Table' do |t|
112109
t.integer :column, default: nil, comment: 'I am a column', null: true

0 commit comments

Comments
 (0)