diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f4d6fefdfb..a6e1da5d7e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -752,13 +752,6 @@ Style/OpMethod: Style/ParallelAssignment: Enabled: false -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowSafeAssignment. -Style/ParenthesesAroundCondition: - Exclude: - - 'lib/cucumber/multiline_argument/data_table.rb' - # Offense count: 225 # Cop supports --auto-correct. # Configuration parameters: PreferredDelimiters. @@ -986,13 +979,6 @@ Style/SpaceBeforeComma: Exclude: - 'lib/cucumber/term/ansicolor.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment. -Style/SpaceBeforeFirstArg: - Exclude: - - 'spec/cucumber/rb_support/rb_step_definition_spec.rb' - # Offense count: 255 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. @@ -1077,18 +1063,6 @@ Style/SymbolProc: Style/TrailingBlankLines: Enabled: false -# Offense count: 43 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles. -# SupportedStyles: comma, consistent_comma, no_comma -Style/TrailingCommaInLiteral: - Exclude: - - 'lib/cucumber/cli/options.rb' - - 'lib/cucumber/term/ansicolor.rb' - - 'spec/cucumber/file_specs_spec.rb' - - 'spec/cucumber/filters/tag_limits/verifier_spec.rb' - - 'spec/cucumber/formatter/legacy_api/adapter_spec.rb' - # Offense count: 18 # Cop supports --auto-correct. # Reviewed: in pretty_spec.rb, progress_spec.rb offences look false, diff --git a/lib/cucumber/cli/options.rb b/lib/cucumber/cli/options.rb index 598635380f..1422aa6ac1 100644 --- a/lib/cucumber/cli/options.rb +++ b/lib/cucumber/cli/options.rb @@ -316,7 +316,7 @@ def banner 'cucumber examples/i18n/en/features', 'cucumber @rerun.txt (See --format rerun)', 'cucumber examples/i18n/it/features/somma.feature:6:98:113', - 'cucumber -s -i http://rubyurl.com/eeCl', '', '', + 'cucumber -s -i http://rubyurl.com/eeCl', '', '' ].join("\n") end diff --git a/lib/cucumber/multiline_argument/data_table.rb b/lib/cucumber/multiline_argument/data_table.rb index 3f8b42e78a..29911b57ec 100644 --- a/lib/cucumber/multiline_argument/data_table.rb +++ b/lib/cucumber/multiline_argument/data_table.rb @@ -585,7 +585,7 @@ def pad_and_match(a_cell_matrix, other_cell_matrix) #:nodoc: header_values.each_with_index do |v, i| mapped_index = unmatched_cols.index{|unmapped_col| unmapped_col.first == v} - if (mapped_index) + if mapped_index matched_cols << unmatched_cols.delete_at(mapped_index) else mark_as_missing(cols[i]) diff --git a/lib/cucumber/term/ansicolor.rb b/lib/cucumber/term/ansicolor.rb index 8c749c8e26..61cf49a803 100644 --- a/lib/cucumber/term/ansicolor.rb +++ b/lib/cucumber/term/ansicolor.rb @@ -33,7 +33,7 @@ module ANSIColor [ :on_blue , 44 ], [ :on_magenta , 45 ], [ :on_cyan , 46 ], - [ :on_white , 47 ], + [ :on_white , 47 ] ] ATTRIBUTE_NAMES = ATTRIBUTES.transpose.first diff --git a/spec/cucumber/file_specs_spec.rb b/spec/cucumber/file_specs_spec.rb index 88dfd4a432..e4233e6176 100644 --- a/spec/cucumber/file_specs_spec.rb +++ b/spec/cucumber/file_specs_spec.rb @@ -15,7 +15,7 @@ module Cucumber Cucumber::Core::Ast::Location.new('features/foo.feature', 3), Cucumber::Core::Ast::Location.new('features/bar.feature', 4), Cucumber::Core::Ast::Location.new('features/bar.feature', 5), - Cucumber::Core::Ast::Location.new('features/bar.feature', 6), + Cucumber::Core::Ast::Location.new('features/bar.feature', 6) ] end @@ -23,7 +23,7 @@ module Cucumber expect(files.length).to eq 2 expect(files).to eq [ 'features/foo.feature', - 'features/bar.feature', + 'features/bar.feature' ] end @@ -42,7 +42,7 @@ module Cucumber it 'returns a wildcard location for that file' do expect(locations).to eq [ Cucumber::Core::Ast::Location.new('features/foo.feature'), - Cucumber::Core::Ast::Location.new('features/bar.feature', 34), + Cucumber::Core::Ast::Location.new('features/bar.feature', 34) ] end end @@ -53,7 +53,7 @@ module Cucumber it 'returns locations in the order specified' do expect(locations).to eq [ Cucumber::Core::Ast::Location.new('features/foo.feature', 10), - Cucumber::Core::Ast::Location.new('features/foo.feature', 1), + Cucumber::Core::Ast::Location.new('features/foo.feature', 1) ] end end diff --git a/spec/cucumber/filters/tag_limits/verifier_spec.rb b/spec/cucumber/filters/tag_limits/verifier_spec.rb index bc06cf9bda..6d6392f3fc 100644 --- a/spec/cucumber/filters/tag_limits/verifier_spec.rb +++ b/spec/cucumber/filters/tag_limits/verifier_spec.rb @@ -16,7 +16,7 @@ let(:locations) do [ double(:location, to_s: 'path/to/some.feature:3'), - double(:location, to_s: 'path/to/some/other.feature:8'), + double(:location, to_s: 'path/to/some/other.feature:8') ] end diff --git a/spec/cucumber/formatter/legacy_api/adapter_spec.rb b/spec/cucumber/formatter/legacy_api/adapter_spec.rb index 46bdae70c9..e3b2824afd 100644 --- a/spec/cucumber/formatter/legacy_api/adapter_spec.rb +++ b/spec/cucumber/formatter/legacy_api/adapter_spec.rb @@ -106,7 +106,7 @@ def after_hooks(source) step 'passing' end end - end, + end ] runner = Core::Test::Runner.new(events) compile gherkin_docs, runner, default_filters @@ -147,7 +147,7 @@ def after_hooks(source) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -170,7 +170,7 @@ def after_hooks(source) :scenario_name, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -207,7 +207,7 @@ def after_hooks(source) :scenario_name, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -238,7 +238,7 @@ def after_hooks(source) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -276,7 +276,7 @@ def after_hooks(source) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -322,7 +322,7 @@ def after_hooks(source) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -357,7 +357,7 @@ def after_hooks(source) :scenario_name, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -416,7 +416,7 @@ def after_hooks(source) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -498,7 +498,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -580,7 +580,7 @@ def after_hooks(source) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -685,7 +685,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -758,7 +758,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -846,7 +846,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -896,7 +896,7 @@ def after_hooks(source) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -940,7 +940,7 @@ def after_hooks(source) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -994,7 +994,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -1063,7 +1063,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -1132,7 +1132,7 @@ def after_hooks(source) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -1192,7 +1192,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -1267,7 +1267,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -1359,7 +1359,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -1413,7 +1413,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -1473,7 +1473,7 @@ def after_hooks(source) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ] end @@ -1534,7 +1534,7 @@ def after_hooks(source) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ] end end @@ -1581,7 +1581,7 @@ def find_after_step_hooks(_test_case) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end end @@ -1628,7 +1628,7 @@ def apply_before_hooks(test_case) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end @@ -1679,7 +1679,7 @@ def apply_before_hooks(test_case) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end @@ -1741,7 +1741,7 @@ def apply_before_hooks(test_case) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end end @@ -1791,7 +1791,7 @@ def apply_before_hooks(test_case) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end end @@ -1839,7 +1839,7 @@ def apply_after_hooks(test_case) :exception, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end @@ -1900,7 +1900,7 @@ def apply_after_hooks(test_case) :after_examples_array, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end end @@ -1948,7 +1948,7 @@ def apply_after_hooks(test_case) :exception, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end end @@ -1980,7 +1980,7 @@ def apply_after_hooks(test_case) :exception, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end end @@ -2020,7 +2020,7 @@ def find_around_hooks(test_case) :exception, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end end @@ -2068,7 +2068,7 @@ def find_around_hooks(test_case) :after_steps, :after_feature_element, :after_feature, - :after_features, + :after_features ]) end end diff --git a/spec/cucumber/rb_support/rb_step_definition_spec.rb b/spec/cucumber/rb_support/rb_step_definition_spec.rb index 883053c327..680901e216 100644 --- a/spec/cucumber/rb_support/rb_step_definition_spec.rb +++ b/spec/cucumber/rb_support/rb_step_definition_spec.rb @@ -176,7 +176,7 @@ def step_match(text) end it 'allows puts' do - expect(user_interface).to receive(:puts).with('wasup') + expect(user_interface).to receive(:puts).with('wasup') dsl.Given(/Loud/) do puts 'wasup' end