rbhint 0.85.1.rc1 → 0.85.1.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -2
  3. data/assets/output.html.erb +1 -1
  4. data/config/default.yml +13 -1
  5. data/lib/rbhint.rb +8 -0
  6. data/lib/rbhint/version.rb +1 -1
  7. data/lib/rubocop.rb +2 -0
  8. data/lib/rubocop/config.rb +1 -1
  9. data/lib/rubocop/config_loader_resolver.rb +1 -1
  10. data/lib/rubocop/cop/gemspec/required_ruby_version.rb +1 -1
  11. data/lib/rubocop/cop/generator/configuration_injector.rb +1 -1
  12. data/lib/rubocop/cop/layout/assignment_indentation.rb +2 -2
  13. data/lib/rubocop/cop/layout/block_alignment.rb +1 -1
  14. data/lib/rubocop/cop/layout/block_end_newline.rb +1 -1
  15. data/lib/rubocop/cop/layout/case_indentation.rb +2 -2
  16. data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +1 -1
  17. data/lib/rubocop/cop/layout/comment_indentation.rb +4 -4
  18. data/lib/rubocop/cop/layout/condition_position.rb +1 -1
  19. data/lib/rubocop/cop/layout/def_end_alignment.rb +1 -1
  20. data/lib/rubocop/cop/layout/dot_position.rb +1 -1
  21. data/lib/rubocop/cop/layout/else_alignment.rb +1 -1
  22. data/lib/rubocop/cop/layout/empty_comment.rb +2 -2
  23. data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +1 -1
  24. data/lib/rubocop/cop/layout/empty_line_between_defs.rb +2 -2
  25. data/lib/rubocop/cop/layout/empty_lines.rb +1 -1
  26. data/lib/rubocop/cop/layout/empty_lines_around_arguments.rb +1 -1
  27. data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +2 -0
  28. data/lib/rubocop/cop/layout/empty_lines_around_begin_body.rb +1 -1
  29. data/lib/rubocop/cop/layout/empty_lines_around_block_body.rb +1 -1
  30. data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +1 -1
  31. data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +2 -2
  32. data/lib/rubocop/cop/layout/empty_lines_around_method_body.rb +1 -1
  33. data/lib/rubocop/cop/layout/empty_lines_around_module_body.rb +1 -1
  34. data/lib/rubocop/cop/layout/end_alignment.rb +1 -1
  35. data/lib/rubocop/cop/layout/end_of_line.rb +2 -2
  36. data/lib/rubocop/cop/layout/extra_spacing.rb +6 -6
  37. data/lib/rubocop/cop/layout/first_argument_indentation.rb +3 -3
  38. data/lib/rubocop/cop/layout/first_array_element_indentation.rb +2 -2
  39. data/lib/rubocop/cop/layout/first_array_element_line_break.rb +2 -2
  40. data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +2 -2
  41. data/lib/rubocop/cop/layout/first_hash_element_line_break.rb +1 -1
  42. data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +1 -1
  43. data/lib/rubocop/cop/layout/first_method_parameter_line_break.rb +1 -1
  44. data/lib/rubocop/cop/layout/first_parameter_indentation.rb +2 -2
  45. data/lib/rubocop/cop/layout/hash_alignment.rb +1 -1
  46. data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +1 -1
  47. data/lib/rubocop/cop/layout/heredoc_indentation.rb +3 -3
  48. data/lib/rubocop/cop/layout/indentation_consistency.rb +1 -1
  49. data/lib/rubocop/cop/layout/indentation_style.rb +1 -1
  50. data/lib/rubocop/cop/layout/indentation_width.rb +2 -2
  51. data/lib/rubocop/cop/layout/initial_indentation.rb +1 -1
  52. data/lib/rubocop/cop/layout/leading_comment_space.rb +1 -1
  53. data/lib/rubocop/cop/layout/leading_empty_lines.rb +1 -1
  54. data/lib/rubocop/cop/layout/line_length.rb +6 -6
  55. data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +1 -1
  56. data/lib/rubocop/cop/layout/multiline_array_line_breaks.rb +1 -1
  57. data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +1 -1
  58. data/lib/rubocop/cop/layout/multiline_block_layout.rb +1 -1
  59. data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +1 -1
  60. data/lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb +1 -1
  61. data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -1
  62. data/lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +1 -1
  63. data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +1 -1
  64. data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +1 -1
  65. data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +1 -1
  66. data/lib/rubocop/cop/layout/parameter_alignment.rb +1 -1
  67. data/lib/rubocop/cop/layout/space_after_colon.rb +2 -2
  68. data/lib/rubocop/cop/layout/space_around_block_parameters.rb +1 -1
  69. data/lib/rubocop/cop/layout/space_around_keyword.rb +2 -2
  70. data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +6 -6
  71. data/lib/rubocop/cop/layout/space_around_operators.rb +2 -2
  72. data/lib/rubocop/cop/layout/space_before_block_braces.rb +14 -0
  73. data/lib/rubocop/cop/layout/space_before_comment.rb +1 -1
  74. data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +1 -1
  75. data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +1 -1
  76. data/lib/rubocop/cop/layout/space_inside_block_braces.rb +1 -1
  77. data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +2 -2
  78. data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +1 -1
  79. data/lib/rubocop/cop/layout/trailing_empty_lines.rb +1 -1
  80. data/lib/rubocop/cop/layout/trailing_whitespace.rb +1 -1
  81. data/lib/rubocop/cop/lint/constant_resolution.rb +89 -0
  82. data/lib/rubocop/cop/lint/float_out_of_range.rb +1 -1
  83. data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +6 -1
  84. data/lib/rubocop/cop/lint/percent_string_array.rb +1 -1
  85. data/lib/rubocop/cop/lint/percent_symbol_array.rb +1 -1
  86. data/lib/rubocop/cop/lint/raise_exception.rb +4 -4
  87. data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +4 -2
  88. data/lib/rubocop/cop/lint/safe_navigation_with_empty.rb +1 -1
  89. data/lib/rubocop/cop/metrics/abc_size.rb +1 -1
  90. data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +35 -3
  91. data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +1 -1
  92. data/lib/rubocop/cop/metrics/utils/iterating_block.rb +61 -0
  93. data/lib/rubocop/cop/mixin/configurable_naming.rb +1 -1
  94. data/lib/rubocop/cop/mixin/documentation_comment.rb +2 -2
  95. data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -1
  96. data/lib/rubocop/cop/mixin/first_element_line_break.rb +1 -1
  97. data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +1 -1
  98. data/lib/rubocop/cop/mixin/parentheses.rb +1 -2
  99. data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +1 -1
  100. data/lib/rubocop/cop/mixin/range_help.rb +1 -1
  101. data/lib/rubocop/cop/mixin/regexp_literal_help.rb +27 -0
  102. data/lib/rubocop/cop/mixin/string_literals_help.rb +1 -1
  103. data/lib/rubocop/cop/mixin/surrounding_space.rb +3 -3
  104. data/lib/rubocop/cop/mixin/trailing_comma.rb +1 -1
  105. data/lib/rubocop/cop/mixin/uncommunicative_name.rb +2 -2
  106. data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +1 -1
  107. data/lib/rubocop/cop/naming/file_name.rb +1 -3
  108. data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +1 -1
  109. data/lib/rubocop/cop/style/bare_percent_literals.rb +1 -1
  110. data/lib/rubocop/cop/style/block_delimiters.rb +2 -4
  111. data/lib/rubocop/cop/style/class_and_module_children.rb +1 -1
  112. data/lib/rubocop/cop/style/command_literal.rb +1 -1
  113. data/lib/rubocop/cop/style/commented_keyword.rb +2 -2
  114. data/lib/rubocop/cop/style/conditional_assignment.rb +1 -1
  115. data/lib/rubocop/cop/style/copyright.rb +3 -3
  116. data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +1 -1
  117. data/lib/rubocop/cop/style/documentation.rb +2 -2
  118. data/lib/rubocop/cop/style/empty_case_condition.rb +8 -6
  119. data/lib/rubocop/cop/style/encoding.rb +1 -1
  120. data/lib/rubocop/cop/style/exponential_notation.rb +2 -2
  121. data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +1 -1
  122. data/lib/rubocop/cop/style/identical_conditional_branches.rb +1 -1
  123. data/lib/rubocop/cop/style/if_inside_else.rb +1 -1
  124. data/lib/rubocop/cop/style/inverse_methods.rb +1 -1
  125. data/lib/rubocop/cop/style/ip_addresses.rb +1 -1
  126. data/lib/rubocop/cop/style/multiline_if_then.rb +1 -1
  127. data/lib/rubocop/cop/style/multiline_ternary_operator.rb +17 -6
  128. data/lib/rubocop/cop/style/nested_ternary_operator.rb +27 -0
  129. data/lib/rubocop/cop/style/next.rb +2 -2
  130. data/lib/rubocop/cop/style/numeric_literal_prefix.rb +2 -2
  131. data/lib/rubocop/cop/style/percent_literal_delimiters.rb +1 -1
  132. data/lib/rubocop/cop/style/redundant_parentheses.rb +1 -1
  133. data/lib/rubocop/cop/style/redundant_percent_q.rb +2 -2
  134. data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +2 -2
  135. data/lib/rubocop/cop/style/redundant_regexp_escape.rb +14 -23
  136. data/lib/rubocop/cop/style/redundant_self.rb +6 -9
  137. data/lib/rubocop/cop/style/sample.rb +1 -1
  138. data/lib/rubocop/cop/style/semicolon.rb +1 -1
  139. data/lib/rubocop/cop/style/struct_inheritance.rb +21 -0
  140. data/lib/rubocop/cop/style/symbol_array.rb +5 -5
  141. data/lib/rubocop/cop/style/ternary_parentheses.rb +1 -1
  142. data/lib/rubocop/cop/style/word_array.rb +1 -1
  143. data/lib/rubocop/cop/util.rb +2 -2
  144. data/lib/rubocop/cop/utils/format_string.rb +1 -1
  145. data/lib/rubocop/formatter/disabled_config_formatter.rb +1 -1
  146. data/lib/rubocop/formatter/formatter_set.rb +1 -1
  147. data/lib/rubocop/name_similarity.rb +6 -0
  148. data/lib/rubocop/path_util.rb +2 -2
  149. data/lib/rubocop/platform.rb +1 -1
  150. data/lib/rubocop/rspec/expect_offense.rb +12 -2
  151. data/lib/rubocop/target_finder.rb +1 -1
  152. data/lib/rubocop/target_ruby.rb +1 -1
  153. metadata +10 -2
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks whether the end keywords are aligned properly.
6
+ # This hint checks whether the end keywords are aligned properly.
7
7
  #
8
8
  # Three modes are supported through the `EnforcedStyleAlignWith`
9
9
  # configuration parameter:
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks for Windows-style line endings in the source code.
6
+ # This hint checks for Windows-style line endings in the source code.
7
7
  #
8
8
  # @example EnforcedStyle: native (default)
9
9
  # # The `native` style means that CR+LF (Carriage Return + Line Feed) is
@@ -65,7 +65,7 @@ module RuboCop
65
65
 
66
66
  # If there is no LF on the last line, we don't care if there's no CR.
67
67
  def unimportant_missing_cr?(index, last_line, line)
68
- style == :crlf && index == last_line - 1 && line !~ /\n$/
68
+ style == :crlf && index == last_line - 1 && !/\n$/.match?(line)
69
69
  end
70
70
 
71
71
  def offense_message(line)
@@ -5,20 +5,20 @@ require 'set'
5
5
  module RuboCop
6
6
  module Cop
7
7
  module Layout
8
- # This cop checks for extra/unnecessary whitespace.
8
+ # This hint checks for extra/unnecessary whitespace.
9
9
  #
10
10
  # @example
11
11
  #
12
12
  # # good if AllowForAlignment is true
13
- # name = "RuboCop"
13
+ # name = "RbHint"
14
14
  # # Some comment and an empty line
15
15
  #
16
- # website += "/rubocop-hq/rubocop" unless cond
17
- # puts "rubocop" if debug
16
+ # website += "/zspencer/rbhint" unless cond
17
+ # puts "rbhint" if debug
18
18
  #
19
19
  # # bad for any configuration
20
- # set_app("RuboCop")
21
- # website = "https://github.com/rubocop-hq/rubocop"
20
+ # set_app("RbHint")
21
+ # website = "https://github.com/zspencer/rbhint"
22
22
  #
23
23
  # # good only if AllowBeforeTrailingComments is true
24
24
  # object.method(arg) # this is a comment
@@ -3,9 +3,9 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks the indentation of the first argument in a method call.
6
+ # This hint checks the indentation of the first argument in a method call.
7
7
  # Arguments after the first one are checked by Layout/ArgumentAlignment,
8
- # not by this cop.
8
+ # not by this hint.
9
9
  #
10
10
  # For indenting the first parameter of method _definitions_, check out
11
11
  # Layout/FirstParameterIndentation.
@@ -168,7 +168,7 @@ module RuboCop
168
168
 
169
169
  send_node = arg_node.parent
170
170
  text = base_range(send_node, arg_node).source.strip
171
- base = if text !~ /\n/ && special_inner_call_indentation?(send_node)
171
+ base = if !/\n/.match?(text) && special_inner_call_indentation?(send_node)
172
172
  "`#{text}`"
173
173
  elsif comment_line?(text.lines.reverse_each.first)
174
174
  'the start of the previous line (not counting the comment)'
@@ -3,9 +3,9 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks the indentation of the first element in an array literal
6
+ # This hint checks the indentation of the first element in an array literal
7
7
  # where the opening bracket and the first element are on separate lines.
8
- # The other elements' indentations are handled by the ArrayAlignment cop.
8
+ # The other elements' indentations are handled by the ArrayAlignment hint.
9
9
  #
10
10
  # By default, array literals that are arguments in a method call with
11
11
  # parentheses, and where the opening square bracket of the array is on the
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks for a line break before the first element in a
6
+ # This hint checks for a line break before the first element in a
7
7
  # multi-line array.
8
8
  #
9
9
  # @example
@@ -37,7 +37,7 @@ module RuboCop
37
37
 
38
38
  def assignment_on_same_line?(node)
39
39
  source = node.source_range.source_line[0...node.loc.column]
40
- source =~ /\s*=\s*$/
40
+ /\s*=\s*$/.match?(source)
41
41
  end
42
42
  end
43
43
  end
@@ -3,9 +3,9 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks the indentation of the first key in a hash literal
6
+ # This hint checks the indentation of the first key in a hash literal
7
7
  # where the opening brace and the first key are on separate lines. The
8
- # other keys' indentations are handled by the HashAlignment cop.
8
+ # other keys' indentations are handled by the HashAlignment hint.
9
9
  #
10
10
  # By default, Hash literals that are arguments in a method call with
11
11
  # parentheses, and where the opening curly brace of the hash is on the
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks for a line break before the first element in a
6
+ # This hint checks for a line break before the first element in a
7
7
  # multi-line hash.
8
8
  #
9
9
  # @example
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks for a line break before the first argument in a
6
+ # This hint checks for a line break before the first argument in a
7
7
  # multi-line method call.
8
8
  #
9
9
  # @example
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks for a line break before the first parameter in a
6
+ # This hint checks for a line break before the first parameter in a
7
7
  # multi-line method parameter definition.
8
8
  #
9
9
  # @example
@@ -3,9 +3,9 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks the indentation of the first parameter in a method
6
+ # This hint checks the indentation of the first parameter in a method
7
7
  # definition. Parameters after the first one are checked by
8
- # Layout/ParameterAlignment, not by this cop.
8
+ # Layout/ParameterAlignment, not by this hint.
9
9
  #
10
10
  # For indenting the first argument of method _calls_, check out
11
11
  # Layout/FirstArgumentIndentation, which supports options related to
@@ -200,7 +200,7 @@ module RuboCop
200
200
  alias on_super on_send
201
201
  alias on_yield on_send
202
202
 
203
- def on_hash(node)
203
+ def on_hash(node) # rubocop:todo Metrics/CyclomaticComplexity
204
204
  return if ignored_node?(node)
205
205
  return if node.pairs.empty? || node.single_line?
206
206
 
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks for the placement of the closing parenthesis
6
+ # This hint checks for the placement of the closing parenthesis
7
7
  # in a method call that passes a HEREDOC string as an argument.
8
8
  # It should be placed at the end of the line containing the
9
9
  # opening HEREDOC tag.
@@ -3,12 +3,12 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks the indentation of the here document bodies. The bodies
6
+ # This hint checks the indentation of the here document bodies. The bodies
7
7
  # are indented one step.
8
8
  #
9
9
  # Note: When ``Layout/LineLength``'s `AllowHeredoc` is false (not default),
10
- # this cop does not add any offenses for long here documents to
11
- # avoid `Layout/LineLength`'s offenses.
10
+ # this hint does not add any flags for long here documents to
11
+ # avoid `Layout/LineLength`'s flags.
12
12
  #
13
13
  # @example
14
14
  # # bad
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks for inconsistent indentation.
6
+ # This hint checks for inconsistent indentation.
7
7
  #
8
8
  # The difference between `indented_internal_methods` and `normal` is
9
9
  # that the `indented_internal_methods` style prescribes that in
@@ -5,7 +5,7 @@ require 'set'
5
5
  module RuboCop
6
6
  module Cop
7
7
  module Layout
8
- # This cop checks that the indentation method is consistent.
8
+ # This hint checks that the indentation method is consistent.
9
9
  # Either tabs only or spaces only are used for indentation.
10
10
  #
11
11
  # @example EnforcedStyle: spaces (default)
@@ -3,10 +3,10 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks for indentation that doesn't use the specified number
6
+ # This hint checks for indentation that doesn't use the specified number
7
7
  # of spaces.
8
8
  #
9
- # See also the IndentationConsistency cop which is the companion to this
9
+ # See also the IndentationConsistency hint which is the companion to this
10
10
  # one.
11
11
  #
12
12
  # @example
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks for indentation of the first non-blank non-comment
6
+ # This hint checks for indentation of the first non-blank non-comment
7
7
  # line in a file.
8
8
  #
9
9
  # @example
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks whether comments have a leading space after the
6
+ # This hint checks whether comments have a leading space after the
7
7
  # `#` denoting the start of the comment. The leading space is not
8
8
  # required for some RDoc special syntax, like `#++`, `#--`,
9
9
  # `#:nodoc`, `=begin`- and `=end` comments, "shebang" directives,
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks for unnecessary leading blank lines at the beginning
6
+ # This hint checks for unnecessary leading blank lines at the beginning
7
7
  # of a file.
8
8
  #
9
9
  # @example
@@ -5,19 +5,19 @@ require 'uri'
5
5
  module RuboCop
6
6
  module Cop
7
7
  module Layout
8
- # This cop checks the length of lines in the source code.
8
+ # This hint checks the length of lines in the source code.
9
9
  # The maximum length is configurable.
10
10
  # The tab size is configured in the `IndentationWidth`
11
- # of the `Layout/IndentationStyle` cop.
11
+ # of the `Layout/IndentationStyle` hint.
12
12
  # It also ignores a shebang line by default.
13
13
  #
14
- # This cop has some autocorrection capabilities.
14
+ # This hint has some autocorrection capabilities.
15
15
  # It can programmatically shorten certain long lines by
16
16
  # inserting line breaks into expressions that can be safely
17
17
  # split across lines. These include arrays, hashes, and
18
18
  # method calls with argument lists.
19
19
  #
20
- # If autocorrection is enabled, the following Layout cops
20
+ # If autocorrection is enabled, the following Layout hints
21
21
  # are recommended to further format the broken lines.
22
22
  # (Many of these are enabled by default.)
23
23
  #
@@ -39,7 +39,7 @@ module RuboCop
39
39
  # * MultilineMethodArgumentLineBreaks
40
40
  # * ParameterAlignment
41
41
  #
42
- # Together, these cops will pretty print hashes, arrays,
42
+ # Together, these hints will pretty print hashes, arrays,
43
43
  # method calls, etc. For example, let's say the max columns
44
44
  # is 25:
45
45
  #
@@ -52,7 +52,7 @@ module RuboCop
52
52
  # {foo: "0000000000",
53
53
  # bar: "0000000000", baz: "0000000000"}
54
54
  #
55
- # # good (with recommended cops enabled)
55
+ # # good (with recommended hints enabled)
56
56
  # {
57
57
  # foo: "0000000000",
58
58
  # bar: "0000000000",
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks that the closing brace in an array literal is either
6
+ # This hint checks that the closing brace in an array literal is either
7
7
  # on the same line as the last array element or on a new line.
8
8
  #
9
9
  # When using the `symmetrical` (default) style:
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop ensures that each item in a multi-line array
6
+ # This hint ensures that each item in a multi-line array
7
7
  # starts on a separate line.
8
8
  #
9
9
  # @example
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks whether the multiline assignments have a newline
6
+ # This hint checks whether the multiline assignments have a newline
7
7
  # after the assignment operator.
8
8
  #
9
9
  # @example EnforcedStyle: new_line (default)
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks whether the multiline do end blocks have a newline
6
+ # This hint checks whether the multiline do end blocks have a newline
7
7
  # after the start of the block. Additionally, it checks whether the block
8
8
  # arguments, if any, are on the same line as the start of the
9
9
  # block. Putting block arguments on separate lines, because the whole
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks that the closing brace in a hash literal is either
6
+ # This hint checks that the closing brace in a hash literal is either
7
7
  # on the same line as the last hash element, or a new line.
8
8
  #
9
9
  # When using the `symmetrical` (default) style:
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop ensures that each key in a multi-line hash
6
+ # This hint ensures that each key in a multi-line hash
7
7
  # starts on a separate line.
8
8
  #
9
9
  # @example
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop ensures that each argument in a multi-line method call
6
+ # This hint ensures that each argument in a multi-line method call
7
7
  # starts on a separate line.
8
8
  #
9
9
  # @example
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks that the closing brace in a method call is either
6
+ # This hint checks that the closing brace in a method call is either
7
7
  # on the same line as the last method argument, or a new line.
8
8
  #
9
9
  # When using the `symmetrical` (default) style:
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks the indentation of the method name part in method calls
6
+ # This hint checks the indentation of the method name part in method calls
7
7
  # that span more than one line.
8
8
  #
9
9
  # @example EnforcedStyle: aligned (default)
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks that the closing brace in a method definition is either
6
+ # This hint checks that the closing brace in a method definition is either
7
7
  # on the same line as the last method parameter, or a new line.
8
8
  #
9
9
  # When using the `symmetrical` (default) style:
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module Layout
6
- # This cop checks the indentation of the right hand side operand in
6
+ # This hint checks the indentation of the right hand side operand in
7
7
  # binary operations that span more than one line.
8
8
  #
9
9
  # The `aligned` style checks that operators are aligned if they are part
@@ -6,7 +6,7 @@ module RuboCop
6
6
  # Here we check if the parameters on a multi-line method call or
7
7
  # definition are aligned.
8
8
  #
9
- # To set the alignment of the first argument, use the cop
9
+ # To set the alignment of the first argument, use the hint
10
10
  # FirstParameterIndentation.
11
11
  #
12
12
  # @example EnforcedStyle: with_first_parameter (default)
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Layout
6
6
  # Checks for colon (:) not followed by some kind of space.
7
- # N.B. this cop does not handle spaces after a ternary operator, which are
7
+ # N.B. this hint does not handle spaces after a ternary operator, which are
8
8
  # instead handled by Layout/SpaceAroundOperators.
9
9
  #
10
10
  # @example
@@ -39,7 +39,7 @@ module RuboCop
39
39
  private
40
40
 
41
41
  def followed_by_space?(colon)
42
- colon.source_buffer.source[colon.end_pos] =~ /\s/
42
+ /\s/.match?(colon.source_buffer.source[colon.end_pos])
43
43
  end
44
44
  end
45
45
  end
@@ -5,7 +5,7 @@ module RuboCop
5
5
  module Layout
6
6
  # Checks the spacing inside and after block parameters pipes. Line breaks
7
7
  # inside parameter pipes are checked by `Layout/MultilineBlockLayout` and
8
- # not by this cop.
8
+ # not by this hint.
9
9
  #
10
10
  # @example EnforcedStyleInsidePipes: no_space (default)
11
11
  # # bad