From 3f0aab39f4246895e8701c3e2f440bc99ff6510d Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Tue, 14 Jul 2020 17:08:28 -0400 Subject: [PATCH] Document Config#for_cop, #for_department [doc] --- lib/rubocop/config.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/rubocop/config.rb b/lib/rubocop/config.rb index ca95268b522..bb08d66a2bf 100644 --- a/lib/rubocop/config.rb +++ b/lib/rubocop/config.rb @@ -104,10 +104,14 @@ def deprecation_check end end + # @return [Config] for the given cop / cop name. + # Note: the 'Enabled' attribute is calculated according to the department's + # and 'AllCops' configuration; other attributes are not inherited. def for_cop(cop) @for_cop[cop.respond_to?(:cop_name) ? cop.cop_name : cop] end + # @return [Config] for the given department name. def for_department(department_name) @for_cop[department_name] end