diff --git a/.rubocop.yml b/.rubocop.yml index 8afd256..7684669 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,31 +8,26 @@ AllCops: # investigating what the fix may be. DisplayStyleGuide: true -# When using Ruby >= 2.3, Rubocop wants to add a comment to the top of *.rb -# to aid migration to frozen literals in Ruby 3.0. We are not interested in -# modifying every file at this point, so this cop is disabled for now. -Style/FrozenStringLiteralComment: - Enabled: false - -# As long as the team commit to using well named classes it should not be -# necessary to add top-level class documentation. -Style/Documentation: - Enabled: false - -# We believe it looks cluttered/ugly not having the ability to add whitespace -# between for example the class declaration and first method. -Style/EmptyLinesAroundModuleBody: +# We believe it looks cluttered not having the ability to have empty lines after +# the module, class, and block declarations +Layout/EmptyLinesAroundBlockBody: Enabled: false -Style/EmptyLinesAroundClassBody: +Layout/EmptyLinesAroundModuleBody: Enabled: false -Style/EmptyLinesAroundBlockBody: +Layout/EmptyLinesAroundClassBody: Enabled: false -# There are no relative performance improvements using '' over "", therefore we -# believe there is more value in using "" for all strings irrespective of -# whether string interpolation is used -Style/StringLiterals: - EnforcedStyle: double_quotes +# We felt as a team that the default size of 15 was too low, and blocked what to +# us are sound methods which would not add any value if broken up. In this +# project we've agreed to up this to 30. +Metrics/AbcSize: + Max: 30 + +# We felt as a team that the default size of 6 was too low, and blocked what to +# us are sound methods which would not add any value if broken up. In this +# project we've agreed to up this to 7. +Metrics/CyclomaticComplexity: + Max: 7 # Steps aren't like traditional methods and don't benefit from being broken # down. Therefore we exclude them from the block length metric as they often can @@ -53,14 +48,26 @@ Metrics/MethodLength: Metrics/LineLength: Max: 120 -# We felt as a team that the default size of 15 was too low, and blocked what to -# us are sound methods which would not add any value if broken up. In this -# project we've agreed to up this to 30. -Metrics/AbcSize: - Max: 30 +# As long as the team commit to using well named classes it should not be +# necessary to add top-level class documentation. +Style/Documentation: + Enabled: false -# We felt as a team that the default size of 6 was too low, and blocked what to -# us are sound methods which would not add any value if broken up. In this -# project we've agreed to up this to 7. -Metrics/CyclomaticComplexity: - Max: 7 +# This rule was added in version 0.49.0. We have nothing against the rule +# however the code we have it doesn't like is anything that uses strftime(). +# We feel the way we are using that is as expected, so have taken the decision +# to turn off this cop. https://github.com/bbatsov/rubocop/issues/3438 +Style/FormatStringToken: + Enabled: false + +# When using Ruby >= 2.3, Rubocop wants to add a comment to the top of *.rb +# to aid migration to frozen literals in Ruby 3.0. We are not interested in +# modifying every file at this point, so this cop is disabled for now. +Style/FrozenStringLiteralComment: + Enabled: false + +# There are no relative performance improvements using '' over "", therefore we +# believe there is more value in using "" for all strings irrespective of +# whether string interpolation is used +Style/StringLiterals: + EnforcedStyle: double_quotes diff --git a/Gemfile.lock b/Gemfile.lock index 6ea98b8..f9cca80 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,6 +6,7 @@ GEM archive-zip (0.7.0) io-like (~> 0.3.0) ast (2.3.0) + browserstack-local (1.3.0) builder (3.2.3) capybara (2.16.1) addressable @@ -46,13 +47,14 @@ GEM parallel (1.12.0) parser (2.4.0.2) ast (~> 2.3) - poltergeist (1.16.0) + poltergeist (1.17.0) capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) powerpack (0.1.1) public_suffix (3.0.1) - quke (0.4.0) + quke (0.6.0) + browserstack-local capybara (~> 2.9) chromedriver-helper (~> 1.0) cucumber (~> 2.4) @@ -64,18 +66,17 @@ GEM rack (2.0.3) rack-test (0.8.2) rack (>= 1.0, < 3) - rainbow (2.2.2) - rake + rainbow (3.0.0) rake (12.3.0) rspec-expectations (3.7.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.7.0) rspec-support (3.7.0) - rubocop (0.51.0) + rubocop (0.52.0) parallel (~> 1.10) - parser (>= 2.3.3.1, < 3.0) + parser (>= 2.4.0.2, < 3.0) powerpack (~> 0.1) - rainbow (>= 2.2.2, < 3.0) + rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-progressbar (1.9.0) diff --git a/features/page_objects/add_exemption_page.rb b/features/page_objects/add_exemption_page.rb index dd88f87..a78c5be 100644 --- a/features/page_objects/add_exemption_page.rb +++ b/features/page_objects/add_exemption_page.rb @@ -6,9 +6,7 @@ class AddExemptionPage < SitePrism::Page element(:submit_button, "input[name='commit']") def submit(args = {}) - if args.key?(:exemption) - exemptions.find { |chk| chk["data-code"] == args[:exemption] }.click - end + exemptions.find { |chk| chk["data-code"] == args[:exemption] }.click if args.key?(:exemption) submit_button.click end diff --git a/features/page_objects/user_type_page.rb b/features/page_objects/user_type_page.rb index 66cbf12..087d4c4 100644 --- a/features/page_objects/user_type_page.rb +++ b/features/page_objects/user_type_page.rb @@ -5,9 +5,7 @@ class UserTypePage < SitePrism::Page element(:submit_button, "input[name='commit']") def submit(args = {}) - if args.key?(:org_type) - org_types.find { |btn| btn.value == args[:org_type] }.click - end + org_types.find { |btn| btn.value == args[:org_type] }.click if args.key?(:org_type) submit_button.click end