From 3c7c345534d5126209346c5d7eb5d5fe89b1a669 Mon Sep 17 00:00:00 2001 From: Neal Chambers Date: Thu, 9 Nov 2023 09:37:45 +0900 Subject: [PATCH] Safely autocorrect Style/ParenthesesAroundCondition Inspecting 1509 files ......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.............. Offenses: spec/system/support/precompile_assets.rb:10:10: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected. next if ^ spec/system/support/precompile_assets.rb:10:11: C: [Corrected] Style/ParenthesesAroundCondition: Don't use parentheses around the condition of an if. next if ( ... ^ spec/system/support/precompile_assets.rb:13:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected. spec/system/support/precompile_assets.rb:14:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. 1509 files inspected, 4 offenses detected, 4 offenses corrected --- .rubocop_todo.yml | 7 ------- spec/system/support/precompile_assets.rb | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 766c7a3275..1d4f9d01bf 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -907,13 +907,6 @@ Style/OptionalBooleanParameter: - 'lib/spree/core/controller_helpers/order.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions. -Style/ParenthesesAroundCondition: - Exclude: - - 'spec/system/support/precompile_assets.rb' - # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. diff --git a/spec/system/support/precompile_assets.rb b/spec/system/support/precompile_assets.rb index 2cf819cbf1..cb137f19e6 100644 --- a/spec/system/support/precompile_assets.rb +++ b/spec/system/support/precompile_assets.rb @@ -7,10 +7,9 @@ RSpec.configure do |config| # rspec --tag ~type:system # # In this case, we don't need to precompile assets. - next if ( + next if config.filter.opposite.rules[:type] == "system" || config.exclude_pattern.match?(%r{spec/system}) - ) config.before(:suite) do # We can use webpack-dev-server for tests, too!