From a36fd4f88caf7adcc8e5da9e28ccffadbcb3a912 Mon Sep 17 00:00:00 2001 From: John Backus Date: Sat, 19 Mar 2016 12:35:50 -0700 Subject: [PATCH] Change `AccessModifierIndentation` cop preference --- config/rubocop.yml | 8 +------- lib/mutant/color.rb | 2 +- lib/mutant/mutator/node/named_value/access.rb | 2 +- spec/unit/mutant/matcher/methods/instance_spec.rb | 6 +++--- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/config/rubocop.yml b/config/rubocop.yml index 32369d8a..d6609070 100644 --- a/config/rubocop.yml +++ b/config/rubocop.yml @@ -17,14 +17,8 @@ CollectionMethods: find: 'detect' find_all: 'select' -# Do not force public/protected/private keyword to be indented at the same -# level as the def keyword. My personal preference is to outdent these keywords -# because I think when scanning code it makes it easier to identify the -# sections of code and visually separate them. When the keyword is at the same -# level I think it sort of blends in with the def keywords and makes it harder -# to scan the code and see where the sections are. AccessModifierIndentation: - Enabled: false + EnforcedStyle: outdent # Limit line length LineLength: diff --git a/lib/mutant/color.rb b/lib/mutant/color.rb index ed44f000..d2c65642 100644 --- a/lib/mutant/color.rb +++ b/lib/mutant/color.rb @@ -24,7 +24,7 @@ module Mutant text end - private + private # rubocop:disable AccessModifierIndentation # Initialize null color # diff --git a/lib/mutant/mutator/node/named_value/access.rb b/lib/mutant/mutator/node/named_value/access.rb index 14669f6d..207ca1c5 100644 --- a/lib/mutant/mutator/node/named_value/access.rb +++ b/lib/mutant/mutator/node/named_value/access.rb @@ -33,7 +33,7 @@ module Mutant super() end - private + private # Emit instance variable as attribute send # diff --git a/spec/unit/mutant/matcher/methods/instance_spec.rb b/spec/unit/mutant/matcher/methods/instance_spec.rb index a0e047e8..2d49d3de 100644 --- a/spec/unit/mutant/matcher/methods/instance_spec.rb +++ b/spec/unit/mutant/matcher/methods/instance_spec.rb @@ -16,17 +16,17 @@ RSpec.describe Mutant::Matcher::Methods::Instance, '#call' do private :method_d - public + public def method_a end - protected + protected def method_b end - private + private def method_c end