From 744616ddf59abeb0da08140c02f0b5195cf96b7c Mon Sep 17 00:00:00 2001 From: Vitali Tatarintev Date: Tue, 29 Mar 2022 11:41:01 +0200 Subject: [PATCH] Fix Style/BisectedAttrAccessor offenses --- .rubocop_todo.yml | 7 ------- lib/system_check/base_check.rb | 12 +++--------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d3b404c4bc2cdb..0423141eeec87e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -379,13 +379,6 @@ Style/AccessorGrouping: Style/BarePercentLiterals: Enabled: false -# Offense count: 6 -# Cop supports --auto-correct. -Style/BisectedAttrAccessor: - Exclude: - - 'lib/system_check/base_check.rb' - - 'qa/qa/resource/api_fabricator.rb' - # Offense count: 42 # Cop supports --auto-correct. Style/CaseLikeIf: diff --git a/lib/system_check/base_check.rb b/lib/system_check/base_check.rb index c36cacbaf4f71e..ae3a9412e5cafc 100644 --- a/lib/system_check/base_check.rb +++ b/lib/system_check/base_check.rb @@ -64,20 +64,14 @@ def self.skip_reason call_or_return(@skip_reason) || 'skipped' end - # Define a reason why we skipped the SystemCheck (during runtime) + # Define or get a reason why we skipped the SystemCheck (during runtime) # # This is used when you need dynamic evaluation like when you have # multiple reasons why a check can fail # # @param [String] reason to be displayed - attr_writer :skip_reason - - # Skip reason defined during runtime - # - # This value have precedence over the one defined in the subclass - # - # @return [String] the reason - attr_reader :skip_reason + # @return [String] reason to be displayed + attr_accessor :skip_reason # Does the check support automatically repair routine? # -- GitLab