Class: RuboCop::Cop::YARD::CollectionStyle

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Includes:
ConfigurableEnforcedStyle, RangeHelp, Helper
Defined in:
lib/rubocop/cop/yard/collection_style.rb

Overview

Examples:

EnforcedStyle short


# bad
# @param [Hash{KeyType => ValueType}]

# bad
# @param [Array(String)]

# bad
# @param [Array<String>]

# good
# @param [{KeyType => ValueType}]

# good
# @param [(String)]

# good
# @param [<String>]

EnforcedStyle long (default)

# bad
# @param [{KeyType => ValueType}]

# bad
# @param [(String)]

# bad
# @param [<String>]

# good
# @param [Hash{KeyType => ValueType}]

# good
# @param [Array(String)]

# good
# @param [Array<String>]

Instance Method Summary collapse

Methods included from Helper

#build_docstring, #each_types_explainer, #extract_tag_types, #inline_comment?, #parse_type, #styled_string

Instance Method Details

#on_new_investigationObject



50
51
52
53
54
55
56
57
# File 'lib/rubocop/cop/yard/collection_style.rb', line 50

def on_new_investigation
  processed_source.comments.each do |comment|
    next if inline_comment?(comment)
    next unless include_yard_tag?(comment)

    check(comment)
  end
end