lib/rubocop/cop/mixin/documentation_comment.rb in rubocop-1.19.1 vs lib/rubocop/cop/mixin/documentation_comment.rb in rubocop-1.20.0

- old
+ new

@@ -3,21 +3,20 @@ module RuboCop module Cop # Common functionality for checking documentation. module DocumentationComment extend NodePattern::Macros - include Style::AnnotationComment private def documentation_comment?(node) preceding_lines = preceding_lines(node) return false unless preceding_comment?(node, preceding_lines.last) preceding_lines.any? do |comment| - !annotation?(comment) && + !AnnotationComment.new(comment, annotation_keywords).annotation? && !interpreter_directive_comment?(comment) && !rubocop_directive_comment?(comment) end end @@ -41,9 +40,13 @@ /^#\s*(frozen_string_literal|encoding):/.match?(comment.text) end def rubocop_directive_comment?(comment) !!DirectiveComment.new(comment).match_captures + end + + def annotation_keywords + config.for_cop('Style/CommentAnnotation')['Keywords'] end end end end