Skip to content

Commit

Permalink
Document Config#for_cop, #for_department [doc]
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Jul 14, 2020
1 parent 6b86210 commit 3f0aab3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rubocop/config.rb
Expand Up @@ -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
Expand Down

0 comments on commit 3f0aab3

Please sign in to comment.