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.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/assets/output.html.erb +1 -1
- data/config/default.yml +13 -1
- data/lib/rbhint.rb +8 -0
- data/lib/rbhint/version.rb +1 -1
- data/lib/rubocop.rb +2 -0
- data/lib/rubocop/config.rb +1 -1
- data/lib/rubocop/config_loader_resolver.rb +1 -1
- data/lib/rubocop/cop/gemspec/required_ruby_version.rb +1 -1
- data/lib/rubocop/cop/generator/configuration_injector.rb +1 -1
- data/lib/rubocop/cop/layout/assignment_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/block_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/block_end_newline.rb +1 -1
- data/lib/rubocop/cop/layout/case_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/comment_indentation.rb +4 -4
- data/lib/rubocop/cop/layout/condition_position.rb +1 -1
- data/lib/rubocop/cop/layout/def_end_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/dot_position.rb +1 -1
- data/lib/rubocop/cop/layout/else_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/empty_comment.rb +2 -2
- data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +1 -1
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +2 -2
- data/lib/rubocop/cop/layout/empty_lines.rb +1 -1
- data/lib/rubocop/cop/layout/empty_lines_around_arguments.rb +1 -1
- data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +2 -0
- data/lib/rubocop/cop/layout/empty_lines_around_begin_body.rb +1 -1
- data/lib/rubocop/cop/layout/empty_lines_around_block_body.rb +1 -1
- data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +1 -1
- data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +2 -2
- data/lib/rubocop/cop/layout/empty_lines_around_method_body.rb +1 -1
- data/lib/rubocop/cop/layout/empty_lines_around_module_body.rb +1 -1
- data/lib/rubocop/cop/layout/end_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/end_of_line.rb +2 -2
- data/lib/rubocop/cop/layout/extra_spacing.rb +6 -6
- data/lib/rubocop/cop/layout/first_argument_indentation.rb +3 -3
- data/lib/rubocop/cop/layout/first_array_element_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/first_array_element_line_break.rb +2 -2
- data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/first_hash_element_line_break.rb +1 -1
- data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +1 -1
- data/lib/rubocop/cop/layout/first_method_parameter_line_break.rb +1 -1
- data/lib/rubocop/cop/layout/first_parameter_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/hash_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +1 -1
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +3 -3
- data/lib/rubocop/cop/layout/indentation_consistency.rb +1 -1
- data/lib/rubocop/cop/layout/indentation_style.rb +1 -1
- data/lib/rubocop/cop/layout/indentation_width.rb +2 -2
- data/lib/rubocop/cop/layout/initial_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/leading_comment_space.rb +1 -1
- data/lib/rubocop/cop/layout/leading_empty_lines.rb +1 -1
- data/lib/rubocop/cop/layout/line_length.rb +6 -6
- data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_array_line_breaks.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/parameter_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/space_after_colon.rb +2 -2
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +1 -1
- data/lib/rubocop/cop/layout/space_around_keyword.rb +2 -2
- data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +6 -6
- data/lib/rubocop/cop/layout/space_around_operators.rb +2 -2
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +14 -0
- data/lib/rubocop/cop/layout/space_before_comment.rb +1 -1
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +2 -2
- data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +1 -1
- data/lib/rubocop/cop/layout/trailing_empty_lines.rb +1 -1
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +1 -1
- data/lib/rubocop/cop/lint/constant_resolution.rb +89 -0
- data/lib/rubocop/cop/lint/float_out_of_range.rb +1 -1
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +6 -1
- data/lib/rubocop/cop/lint/percent_string_array.rb +1 -1
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +1 -1
- data/lib/rubocop/cop/lint/raise_exception.rb +4 -4
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +4 -2
- data/lib/rubocop/cop/lint/safe_navigation_with_empty.rb +1 -1
- data/lib/rubocop/cop/metrics/abc_size.rb +1 -1
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +35 -3
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/iterating_block.rb +61 -0
- data/lib/rubocop/cop/mixin/configurable_naming.rb +1 -1
- data/lib/rubocop/cop/mixin/documentation_comment.rb +2 -2
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +1 -1
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +1 -1
- data/lib/rubocop/cop/mixin/parentheses.rb +1 -2
- data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/range_help.rb +1 -1
- data/lib/rubocop/cop/mixin/regexp_literal_help.rb +27 -0
- data/lib/rubocop/cop/mixin/string_literals_help.rb +1 -1
- data/lib/rubocop/cop/mixin/surrounding_space.rb +3 -3
- data/lib/rubocop/cop/mixin/trailing_comma.rb +1 -1
- data/lib/rubocop/cop/mixin/uncommunicative_name.rb +2 -2
- data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +1 -1
- data/lib/rubocop/cop/naming/file_name.rb +1 -3
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +1 -1
- data/lib/rubocop/cop/style/bare_percent_literals.rb +1 -1
- data/lib/rubocop/cop/style/block_delimiters.rb +2 -4
- data/lib/rubocop/cop/style/class_and_module_children.rb +1 -1
- data/lib/rubocop/cop/style/command_literal.rb +1 -1
- data/lib/rubocop/cop/style/commented_keyword.rb +2 -2
- data/lib/rubocop/cop/style/conditional_assignment.rb +1 -1
- data/lib/rubocop/cop/style/copyright.rb +3 -3
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +1 -1
- data/lib/rubocop/cop/style/documentation.rb +2 -2
- data/lib/rubocop/cop/style/empty_case_condition.rb +8 -6
- data/lib/rubocop/cop/style/encoding.rb +1 -1
- data/lib/rubocop/cop/style/exponential_notation.rb +2 -2
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +1 -1
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +1 -1
- data/lib/rubocop/cop/style/if_inside_else.rb +1 -1
- data/lib/rubocop/cop/style/inverse_methods.rb +1 -1
- data/lib/rubocop/cop/style/ip_addresses.rb +1 -1
- data/lib/rubocop/cop/style/multiline_if_then.rb +1 -1
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +17 -6
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +27 -0
- data/lib/rubocop/cop/style/next.rb +2 -2
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +2 -2
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +1 -1
- data/lib/rubocop/cop/style/redundant_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/redundant_percent_q.rb +2 -2
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +2 -2
- data/lib/rubocop/cop/style/redundant_regexp_escape.rb +14 -23
- data/lib/rubocop/cop/style/redundant_self.rb +6 -9
- data/lib/rubocop/cop/style/sample.rb +1 -1
- data/lib/rubocop/cop/style/semicolon.rb +1 -1
- data/lib/rubocop/cop/style/struct_inheritance.rb +21 -0
- data/lib/rubocop/cop/style/symbol_array.rb +5 -5
- data/lib/rubocop/cop/style/ternary_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/word_array.rb +1 -1
- data/lib/rubocop/cop/util.rb +2 -2
- data/lib/rubocop/cop/utils/format_string.rb +1 -1
- data/lib/rubocop/formatter/disabled_config_formatter.rb +1 -1
- data/lib/rubocop/formatter/formatter_set.rb +1 -1
- data/lib/rubocop/name_similarity.rb +6 -0
- data/lib/rubocop/path_util.rb +2 -2
- data/lib/rubocop/platform.rb +1 -1
- data/lib/rubocop/rspec/expect_offense.rb +12 -2
- data/lib/rubocop/target_finder.rb +1 -1
- data/lib/rubocop/target_ruby.rb +1 -1
- metadata +10 -2
@@ -3,7 +3,7 @@
|
|
3
3
|
module RuboCop
|
4
4
|
module Cop
|
5
5
|
module Layout
|
6
|
-
# This
|
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
|
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
|
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
|
8
|
+
# This hint checks for extra/unnecessary whitespace.
|
9
9
|
#
|
10
10
|
# @example
|
11
11
|
#
|
12
12
|
# # good if AllowForAlignment is true
|
13
|
-
# name = "
|
13
|
+
# name = "RbHint"
|
14
14
|
# # Some comment and an empty line
|
15
15
|
#
|
16
|
-
# website += "/
|
17
|
-
# puts "
|
16
|
+
# website += "/zspencer/rbhint" unless cond
|
17
|
+
# puts "rbhint" if debug
|
18
18
|
#
|
19
19
|
# # bad for any configuration
|
20
|
-
# set_app("
|
21
|
-
# website = "https://github.com/
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
-
|
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
|
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
|
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,9 +3,9 @@
|
|
3
3
|
module RuboCop
|
4
4
|
module Cop
|
5
5
|
module Layout
|
6
|
-
# This
|
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
|
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
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module RuboCop
|
4
4
|
module Cop
|
5
5
|
module Layout
|
6
|
-
# This
|
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
|
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
|
11
|
-
# avoid `Layout/LineLength`'s
|
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
|
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
|
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
|
6
|
+
# This hint checks for indentation that doesn't use the specified number
|
7
7
|
# of spaces.
|
8
8
|
#
|
9
|
-
# See also the IndentationConsistency
|
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
|
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,
|
@@ -5,19 +5,19 @@ require 'uri'
|
|
5
5
|
module RuboCop
|
6
6
|
module Cop
|
7
7
|
module Layout
|
8
|
-
# This
|
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`
|
11
|
+
# of the `Layout/IndentationStyle` hint.
|
12
12
|
# It also ignores a shebang line by default.
|
13
13
|
#
|
14
|
-
# This
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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]
|
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
|
8
|
+
# not by this hint.
|
9
9
|
#
|
10
10
|
# @example EnforcedStyleInsidePipes: no_space (default)
|
11
11
|
# # bad
|