rubocop 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubocop might be problematic. Click here for more details.
- data/CHANGELOG.md +40 -0
- data/README.md +49 -8
- data/config/default.yml +40 -0
- data/config/enabled.yml +37 -9
- data/lib/rubocop.rb +24 -10
- data/lib/rubocop/cli.rb +41 -106
- data/lib/rubocop/config.rb +3 -2
- data/lib/rubocop/cop/commissioner.rb +15 -5
- data/lib/rubocop/cop/cop.rb +47 -32
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +2 -2
- data/lib/rubocop/cop/lint/block_alignment.rb +30 -9
- data/lib/rubocop/cop/lint/empty_ensure.rb +1 -1
- data/lib/rubocop/cop/lint/end_alignment.rb +4 -4
- data/lib/rubocop/cop/lint/end_in_method.rb +1 -1
- data/lib/rubocop/cop/lint/ensure_return.rb +1 -1
- data/lib/rubocop/cop/lint/eval.rb +1 -3
- data/lib/rubocop/cop/lint/handle_exceptions.rb +1 -1
- data/lib/rubocop/cop/lint/literal_in_condition.rb +6 -4
- data/lib/rubocop/cop/lint/loop.rb +1 -1
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +1 -1
- data/lib/rubocop/cop/lint/rescue_exception.rb +1 -1
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +5 -8
- data/lib/rubocop/cop/lint/unreachable_code.rb +1 -1
- data/lib/rubocop/cop/lint/useless_assignment.rb +57 -60
- data/lib/rubocop/cop/lint/useless_comparison.rb +1 -1
- data/lib/rubocop/cop/lint/useless_setter_call.rb +85 -0
- data/lib/rubocop/cop/lint/void.rb +6 -8
- data/lib/rubocop/cop/rails/has_and_belongs_to_many.rb +1 -1
- data/lib/rubocop/cop/rails/read_attribute.rb +1 -1
- data/lib/rubocop/cop/rails/validation.rb +1 -1
- data/lib/rubocop/cop/style/access_control.rb +4 -6
- data/lib/rubocop/cop/style/alias.rb +1 -3
- data/lib/rubocop/cop/style/align_array.rb +47 -0
- data/lib/rubocop/cop/style/align_hash.rb +145 -0
- data/lib/rubocop/cop/style/align_parameters.rb +9 -3
- data/lib/rubocop/cop/style/and_or.rb +3 -4
- data/lib/rubocop/cop/style/ascii_comments.rb +1 -3
- data/lib/rubocop/cop/style/ascii_identifiers.rb +1 -1
- data/lib/rubocop/cop/style/attr.rb +1 -4
- data/lib/rubocop/cop/style/begin_block.rb +1 -1
- data/lib/rubocop/cop/style/block_comments.rb +1 -1
- data/lib/rubocop/cop/style/block_nesting.rb +2 -2
- data/lib/rubocop/cop/style/blocks.rb +14 -2
- data/lib/rubocop/cop/style/case_equality.rb +1 -3
- data/lib/rubocop/cop/style/case_indentation.rb +1 -1
- data/lib/rubocop/cop/style/character_literal.rb +1 -2
- data/lib/rubocop/cop/style/class_and_module_camel_case.rb +1 -1
- data/lib/rubocop/cop/style/class_methods.rb +1 -3
- data/lib/rubocop/cop/style/{avoid_class_vars.rb → class_vars.rb} +6 -2
- data/lib/rubocop/cop/style/collection_methods.rb +7 -9
- data/lib/rubocop/cop/style/colon_method_call.rb +1 -2
- data/lib/rubocop/cop/style/comment_annotation.rb +6 -6
- data/lib/rubocop/cop/style/constant_name.rb +1 -3
- data/lib/rubocop/cop/style/def_parentheses.rb +4 -12
- data/lib/rubocop/cop/style/documentation.rb +2 -2
- data/lib/rubocop/cop/style/dot_position.rb +2 -4
- data/lib/rubocop/cop/style/empty_line_between_defs.rb +21 -6
- data/lib/rubocop/cop/style/empty_lines.rb +1 -1
- data/lib/rubocop/cop/style/empty_literal.rb +3 -12
- data/lib/rubocop/cop/style/encoding.rb +6 -6
- data/lib/rubocop/cop/style/end_block.rb +1 -1
- data/lib/rubocop/cop/style/end_of_line.rb +5 -5
- data/lib/rubocop/cop/style/even_odd.rb +2 -2
- data/lib/rubocop/cop/style/favor_join.rb +1 -3
- data/lib/rubocop/cop/style/favor_modifier.rb +7 -3
- data/lib/rubocop/cop/style/favor_sprintf.rb +1 -1
- data/lib/rubocop/cop/style/favor_unless_over_negated_if.rb +1 -1
- data/lib/rubocop/cop/style/final_newline.rb +23 -0
- data/lib/rubocop/cop/style/{avoid_for.rb → for.rb} +2 -2
- data/lib/rubocop/cop/style/{avoid_global_vars.rb → global_vars.rb} +19 -6
- data/lib/rubocop/cop/style/hash_methods.rb +3 -5
- data/lib/rubocop/cop/style/hash_syntax.rb +4 -4
- data/lib/rubocop/cop/style/if_then_else.rb +1 -1
- data/lib/rubocop/cop/style/indentation_width.rb +4 -4
- data/lib/rubocop/cop/style/lambda.rb +2 -2
- data/lib/rubocop/cop/style/leading_comment_space.rb +1 -1
- data/lib/rubocop/cop/style/line_length.rb +7 -8
- data/lib/rubocop/cop/style/method_and_variable_snake_case.rb +1 -1
- data/lib/rubocop/cop/style/method_call_parentheses.rb +1 -4
- data/lib/rubocop/cop/style/method_length.rb +4 -4
- data/lib/rubocop/cop/style/module_function.rb +1 -3
- data/lib/rubocop/cop/style/multiline_block_chain.rb +44 -0
- data/lib/rubocop/cop/style/nil_comparison.rb +1 -3
- data/lib/rubocop/cop/style/not.rb +1 -1
- data/lib/rubocop/cop/style/numeric_literals.rb +26 -6
- data/lib/rubocop/cop/style/op_method.rb +2 -2
- data/lib/rubocop/cop/style/parameter_lists.rb +4 -4
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +2 -2
- data/lib/rubocop/cop/style/perl_backrefs.rb +26 -0
- data/lib/rubocop/cop/style/proc.rb +1 -3
- data/lib/rubocop/cop/style/reduce_arguments.rb +7 -5
- data/lib/rubocop/cop/style/redundant_begin.rb +1 -1
- data/lib/rubocop/cop/style/redundant_return.rb +9 -2
- data/lib/rubocop/cop/style/redundant_self.rb +9 -2
- data/lib/rubocop/cop/style/regexp_literal.rb +7 -8
- data/lib/rubocop/cop/style/rescue_modifier.rb +1 -1
- data/lib/rubocop/cop/style/semicolon.rb +10 -10
- data/lib/rubocop/cop/style/signal_exception.rb +2 -4
- data/lib/rubocop/cop/style/single_line_methods.rb +2 -4
- data/lib/rubocop/cop/style/space_after_comma_etc.rb +1 -1
- data/lib/rubocop/cop/style/space_after_control_keyword.rb +1 -1
- data/lib/rubocop/cop/style/space_after_method_name.rb +1 -1
- data/lib/rubocop/cop/style/space_before_modifier_keyword.rb +34 -0
- data/lib/rubocop/cop/style/{avoid_perlisms.rb → special_global_vars.rb} +17 -8
- data/lib/rubocop/cop/style/string_literals.rb +1 -2
- data/lib/rubocop/cop/style/surrounding_space.rb +9 -8
- data/lib/rubocop/cop/style/symbol_array.rb +1 -1
- data/lib/rubocop/cop/style/symbol_name.rb +9 -2
- data/lib/rubocop/cop/style/tab.rb +5 -5
- data/lib/rubocop/cop/style/ternary_operator.rb +2 -6
- data/lib/rubocop/cop/style/trailing_blank_lines.rb +32 -0
- data/lib/rubocop/cop/style/trailing_whitespace.rb +5 -6
- data/lib/rubocop/cop/style/trivial_accessors.rb +5 -5
- data/lib/rubocop/cop/style/unless_else.rb +1 -1
- data/lib/rubocop/cop/style/variable_interpolation.rb +1 -3
- data/lib/rubocop/cop/style/when_then.rb +1 -4
- data/lib/rubocop/cop/style/while_until_do.rb +7 -5
- data/lib/rubocop/cop/style/word_array.rb +1 -1
- data/lib/rubocop/cop/team.rb +100 -0
- data/lib/rubocop/cop/variable_inspector.rb +323 -235
- data/lib/rubocop/cop/variable_inspector/assignment.rb +103 -0
- data/lib/rubocop/cop/variable_inspector/locatable.rb +162 -0
- data/lib/rubocop/cop/variable_inspector/reference.rb +31 -0
- data/lib/rubocop/cop/variable_inspector/scope.rb +70 -0
- data/lib/rubocop/cop/variable_inspector/variable.rb +87 -0
- data/lib/rubocop/cop/variable_inspector/variable_table.rb +129 -0
- data/lib/rubocop/formatter/json_formatter.rb +8 -8
- data/lib/rubocop/formatter/progress_formatter.rb +4 -4
- data/lib/rubocop/processed_source.rb +22 -1
- data/lib/rubocop/version.rb +1 -1
- data/rubocop.gemspec +1 -1
- data/spec/rubocop/cli_spec.rb +32 -30
- data/spec/rubocop/config_spec.rb +4 -6
- data/spec/rubocop/cop/commissioner_spec.rb +4 -5
- data/spec/rubocop/cop/cop_spec.rb +8 -26
- data/spec/rubocop/cop/lint/assignment_in_condition_spec.rb +5 -9
- data/spec/rubocop/cop/lint/block_alignment_spec.rb +105 -57
- data/spec/rubocop/cop/lint/empty_ensure_spec.rb +1 -1
- data/spec/rubocop/cop/lint/end_alignment_spec.rb +1 -1
- data/spec/rubocop/cop/lint/end_in_method_spec.rb +1 -1
- data/spec/rubocop/cop/lint/ensure_return_spec.rb +1 -1
- data/spec/rubocop/cop/lint/eval_spec.rb +3 -3
- data/spec/rubocop/cop/lint/handle_exceptions_spec.rb +2 -2
- data/spec/rubocop/cop/lint/literal_in_condition_spec.rb +1 -1
- data/spec/rubocop/cop/lint/loop_spec.rb +1 -1
- data/spec/rubocop/cop/lint/parentheses_as_grouped_expression_spec.rb +1 -1
- data/spec/rubocop/cop/lint/rescue_exception_spec.rb +5 -5
- data/spec/rubocop/cop/lint/unreachable_code_spec.rb +1 -1
- data/spec/rubocop/cop/lint/useless_assignment_spec.rb +1545 -108
- data/spec/rubocop/cop/lint/useless_comparison_spec.rb +1 -1
- data/spec/rubocop/cop/lint/useless_setter_call_spec.rb +101 -0
- data/spec/rubocop/cop/lint/void_spec.rb +1 -1
- data/spec/rubocop/cop/offence_spec.rb +4 -4
- data/spec/rubocop/cop/rails/has_and_belongs_to_many_spec.rb +1 -1
- data/spec/rubocop/cop/rails/read_attribute_spec.rb +1 -1
- data/spec/rubocop/cop/rails/validation_spec.rb +1 -1
- data/spec/rubocop/cop/style/access_control_spec.rb +20 -20
- data/spec/rubocop/cop/style/alias_spec.rb +3 -3
- data/spec/rubocop/cop/style/align_array_spec.rb +62 -0
- data/spec/rubocop/cop/style/align_hash_spec.rb +267 -0
- data/spec/rubocop/cop/style/align_parameters_spec.rb +2 -2
- data/spec/rubocop/cop/style/and_or_spec.rb +1 -1
- data/spec/rubocop/cop/style/ascii_comments_spec.rb +2 -2
- data/spec/rubocop/cop/style/ascii_identifiers_spec.rb +2 -2
- data/spec/rubocop/cop/style/attr_spec.rb +1 -1
- data/spec/rubocop/cop/style/begin_block_spec.rb +1 -1
- data/spec/rubocop/cop/style/block_comments_spec.rb +1 -1
- data/spec/rubocop/cop/style/block_nesting_spec.rb +3 -3
- data/spec/rubocop/cop/style/blocks_spec.rb +25 -1
- data/spec/rubocop/cop/style/case_equality_spec.rb +1 -1
- data/spec/rubocop/cop/style/case_indentation_spec.rb +5 -5
- data/spec/rubocop/cop/style/character_literal_spec.rb +1 -1
- data/spec/rubocop/cop/style/class_and_module_camel_case_spec.rb +1 -1
- data/spec/rubocop/cop/style/class_methods_spec.rb +1 -1
- data/spec/rubocop/cop/style/class_vars_spec.rb +25 -0
- data/spec/rubocop/cop/style/collection_methods_spec.rb +5 -6
- data/spec/rubocop/cop/style/colon_method_call_spec.rb +0 -3
- data/spec/rubocop/cop/style/comment_annotation_spec.rb +20 -18
- data/spec/rubocop/cop/style/constant_name_spec.rb +1 -1
- data/spec/rubocop/cop/style/def_with_parentheses_spec.rb +1 -1
- data/spec/rubocop/cop/style/def_without_parentheses_spec.rb +1 -1
- data/spec/rubocop/cop/style/documentation_spec.rb +1 -1
- data/spec/rubocop/cop/style/dot_position_spec.rb +5 -5
- data/spec/rubocop/cop/style/empty_line_between_defs_spec.rb +35 -4
- data/spec/rubocop/cop/style/empty_lines_spec.rb +1 -1
- data/spec/rubocop/cop/style/empty_literal_spec.rb +7 -7
- data/spec/rubocop/cop/style/encoding_spec.rb +11 -5
- data/spec/rubocop/cop/style/end_block_spec.rb +1 -1
- data/spec/rubocop/cop/style/end_of_line_spec.rb +4 -3
- data/spec/rubocop/cop/style/even_odd_spec.rb +1 -1
- data/spec/rubocop/cop/style/favor_join_spec.rb +2 -2
- data/spec/rubocop/cop/style/favor_modifier_spec.rb +13 -10
- data/spec/rubocop/cop/style/favor_sprintf_spec.rb +4 -4
- data/spec/rubocop/cop/style/favor_unless_over_negated_if_spec.rb +1 -1
- data/spec/rubocop/cop/style/favor_until_over_negated_while_spec.rb +4 -4
- data/spec/rubocop/cop/style/final_newline_spec.rb +25 -0
- data/spec/rubocop/cop/style/{avoid_for_spec.rb → for_spec.rb} +8 -12
- data/spec/rubocop/cop/style/{avoid_global_vars_spec.rb → global_vars_spec.rb} +13 -3
- data/spec/rubocop/cop/style/hash_methods_spec.rb +1 -1
- data/spec/rubocop/cop/style/hash_syntax_spec.rb +20 -9
- data/spec/rubocop/cop/style/if_with_semicolon_spec.rb +3 -3
- data/spec/rubocop/cop/style/indentation_width_spec.rb +19 -19
- data/spec/rubocop/cop/style/lambda_spec.rb +6 -6
- data/spec/rubocop/cop/style/leading_comment_space_spec.rb +1 -1
- data/spec/rubocop/cop/style/line_length_spec.rb +3 -3
- data/spec/rubocop/cop/style/method_and_variable_snake_case_spec.rb +8 -9
- data/spec/rubocop/cop/style/method_call_parentheses_spec.rb +1 -1
- data/spec/rubocop/cop/style/method_length_spec.rb +18 -17
- data/spec/rubocop/cop/style/module_function_spec.rb +1 -1
- data/spec/rubocop/cop/style/multiline_block_chain_spec.rb +84 -0
- data/spec/rubocop/cop/style/multiline_if_then_spec.rb +2 -2
- data/spec/rubocop/cop/style/nil_comparison_spec.rb +1 -1
- data/spec/rubocop/cop/style/not_spec.rb +1 -1
- data/spec/rubocop/cop/style/numeric_literals_spec.rb +15 -25
- data/spec/rubocop/cop/style/one_line_conditional_spec.rb +2 -2
- data/spec/rubocop/cop/style/op_method_spec.rb +3 -3
- data/spec/rubocop/cop/style/parameter_lists_spec.rb +5 -5
- data/spec/rubocop/cop/style/parentheses_around_condition_spec.rb +4 -8
- data/spec/rubocop/cop/style/perl_backrefs_spec.rb +23 -0
- data/spec/rubocop/cop/style/proc_spec.rb +1 -1
- data/spec/rubocop/cop/style/reduce_arguments_spec.rb +18 -11
- data/spec/rubocop/cop/style/redundant_begin_spec.rb +1 -1
- data/spec/rubocop/cop/style/redundant_return_spec.rb +16 -1
- data/spec/rubocop/cop/style/redundant_self_spec.rb +6 -1
- data/spec/rubocop/cop/style/regexp_literal_spec.rb +19 -23
- data/spec/rubocop/cop/style/rescue_modifier_spec.rb +3 -3
- data/spec/rubocop/cop/style/semicolon_spec.rb +3 -3
- data/spec/rubocop/cop/style/signal_exception_spec.rb +1 -1
- data/spec/rubocop/cop/style/single_line_methods_spec.rb +22 -18
- data/spec/rubocop/cop/style/space_after_colon_spec.rb +4 -4
- data/spec/rubocop/cop/style/space_after_comma_spec.rb +4 -4
- data/spec/rubocop/cop/style/space_after_control_keyword_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_after_method_name_spec.rb +1 -1
- data/spec/rubocop/cop/style/space_after_semicolon_spec.rb +3 -3
- data/spec/rubocop/cop/style/space_around_braces_spec.rb +13 -12
- data/spec/rubocop/cop/style/space_around_equals_in_default_parameter_spec.rb +3 -3
- data/spec/rubocop/cop/style/space_around_operators_spec.rb +25 -25
- data/spec/rubocop/cop/style/space_before_modifier_keyword_spec.rb +53 -0
- data/spec/rubocop/cop/style/space_inside_brackets_spec.rb +9 -9
- data/spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb +47 -61
- data/spec/rubocop/cop/style/space_inside_parens_spec.rb +4 -4
- data/spec/rubocop/cop/style/special_global_vars_spec.rb +52 -0
- data/spec/rubocop/cop/style/string_literals_spec.rb +5 -5
- data/spec/rubocop/cop/style/symbol_array_spec.rb +1 -1
- data/spec/rubocop/cop/style/symbol_name_spec.rb +27 -18
- data/spec/rubocop/cop/style/tab_spec.rb +1 -1
- data/spec/rubocop/cop/style/ternary_operator_spec.rb +2 -2
- data/spec/rubocop/cop/style/trailing_blank_lines_spec.rb +24 -0
- data/spec/rubocop/cop/style/trailing_whitespace_spec.rb +7 -7
- data/spec/rubocop/cop/style/trivial_accessors_spec.rb +6 -14
- data/spec/rubocop/cop/style/unless_else_spec.rb +3 -3
- data/spec/rubocop/cop/style/variable_interpolation_spec.rb +5 -5
- data/spec/rubocop/cop/style/when_then_spec.rb +15 -15
- data/spec/rubocop/cop/style/while_until_do_spec.rb +3 -3
- data/spec/rubocop/cop/style/word_array_spec.rb +1 -1
- data/spec/rubocop/cop/team_spec.rb +158 -0
- data/spec/rubocop/cop/variable_inspector/assignment_spec.rb +217 -0
- data/spec/rubocop/cop/variable_inspector/locatable_spec.rb +740 -0
- data/spec/rubocop/cop/variable_inspector/scope_spec.rb +191 -0
- data/spec/rubocop/cop/variable_inspector/variable_spec.rb +79 -0
- data/spec/rubocop/cop/variable_inspector/variable_table_spec.rb +275 -0
- data/spec/rubocop/cop/variable_inspector_spec.rb +13 -533
- data/spec/rubocop/formatter/clang_style_formatter_spec.rb +4 -4
- data/spec/rubocop/formatter/disabled_config_formatter_spec.rb +1 -1
- data/spec/rubocop/formatter/emacs_style_formatter_spec.rb +3 -3
- data/spec/rubocop/formatter/file_list_formatter_spec.rb +3 -3
- data/spec/rubocop/formatter/progress_formatter_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -1
- data/spec/support/ast_helper.rb +15 -0
- data/spec/support/shared_context.rb +18 -0
- data/spec/support/shared_examples.rb +1 -1
- metadata +95 -32
- checksums.yaml +0 -7
- data/lib/rubocop/cop/lint/unused_local_variable.rb +0 -32
- data/lib/rubocop/cop/style/avoid_perl_backrefs.rb +0 -19
- data/spec/rubocop/cop/lint/unused_local_variable_spec.rb +0 -588
- data/spec/rubocop/cop/style/avoid_class_vars_spec.rb +0 -27
- data/spec/rubocop/cop/style/avoid_perl_backrefs_spec.rb +0 -20
- data/spec/rubocop/cop/style/avoid_perlisms_spec.rb +0 -47
@@ -48,10 +48,10 @@ module Rubocop
|
|
48
48
|
cop = Cop::Cop.new
|
49
49
|
source_buffer = Parser::Source::Buffer.new('test', 1)
|
50
50
|
source_buffer.source = ('aa'..'az').to_a.join($RS)
|
51
|
-
cop.add_offence(:convention,
|
51
|
+
cop.add_offence(:convention, nil,
|
52
52
|
Parser::Source::Range.new(source_buffer, 0, 2),
|
53
53
|
'message 1')
|
54
|
-
cop.add_offence(:fatal,
|
54
|
+
cop.add_offence(:fatal, nil,
|
55
55
|
Parser::Source::Range.new(source_buffer, 30, 32),
|
56
56
|
'message 2')
|
57
57
|
|
@@ -69,10 +69,10 @@ module Rubocop
|
|
69
69
|
cop = Cop::Cop.new
|
70
70
|
source_buffer = Parser::Source::Buffer.new('test', 1)
|
71
71
|
source_buffer.source = ([' ', 'yaba']).to_a.join($RS)
|
72
|
-
cop.add_offence(:convention,
|
72
|
+
cop.add_offence(:convention, nil,
|
73
73
|
Parser::Source::Range.new(source_buffer, 0, 2),
|
74
74
|
'message 1')
|
75
|
-
cop.add_offence(:fatal,
|
75
|
+
cop.add_offence(:fatal, nil,
|
76
76
|
Parser::Source::Range.new(source_buffer, 6, 4),
|
77
77
|
'message 2')
|
78
78
|
|
@@ -7,7 +7,7 @@ require 'ostruct'
|
|
7
7
|
module Rubocop
|
8
8
|
module Formatter
|
9
9
|
describe DisabledConfigFormatter do
|
10
|
-
|
10
|
+
subject(:formatter) { DisabledConfigFormatter.new(output) }
|
11
11
|
let(:output) do
|
12
12
|
o = StringIO.new
|
13
13
|
def o.path
|
@@ -6,7 +6,7 @@ require 'stringio'
|
|
6
6
|
module Rubocop
|
7
7
|
module Formatter
|
8
8
|
describe EmacsStyleFormatter do
|
9
|
-
|
9
|
+
subject(:formatter) { EmacsStyleFormatter.new(output) }
|
10
10
|
let(:output) { StringIO.new }
|
11
11
|
|
12
12
|
describe '#file_finished' do
|
@@ -15,10 +15,10 @@ module Rubocop
|
|
15
15
|
source_buffer = Parser::Source::Buffer.new('test', 1)
|
16
16
|
source_buffer.source = %w(a b cdefghi).join("\n")
|
17
17
|
|
18
|
-
cop.add_offence(:convention,
|
18
|
+
cop.add_offence(:convention, nil,
|
19
19
|
Parser::Source::Range.new(source_buffer, 0, 1),
|
20
20
|
'message 1')
|
21
|
-
cop.add_offence(:fatal,
|
21
|
+
cop.add_offence(:fatal, nil,
|
22
22
|
Parser::Source::Range.new(source_buffer, 9, 10),
|
23
23
|
'message 2')
|
24
24
|
|
@@ -6,7 +6,7 @@ require 'stringio'
|
|
6
6
|
module Rubocop
|
7
7
|
module Formatter
|
8
8
|
describe FileListFormatter do
|
9
|
-
|
9
|
+
subject(:formatter) { FileListFormatter.new(output) }
|
10
10
|
let(:output) { StringIO.new }
|
11
11
|
|
12
12
|
describe '#file_finished' do
|
@@ -15,10 +15,10 @@ module Rubocop
|
|
15
15
|
source_buffer = Parser::Source::Buffer.new('test', 1)
|
16
16
|
source_buffer.source = %w(a b cdefghi).join("\n")
|
17
17
|
|
18
|
-
cop.add_offence(:convention,
|
18
|
+
cop.add_offence(:convention, nil,
|
19
19
|
Parser::Source::Range.new(source_buffer, 0, 1),
|
20
20
|
'message 1')
|
21
|
-
cop.add_offence(:fatal,
|
21
|
+
cop.add_offence(:fatal, nil,
|
22
22
|
Parser::Source::Range.new(source_buffer, 9, 10),
|
23
23
|
'message 2')
|
24
24
|
|
data/spec/spec_helper.rb
CHANGED
@@ -90,7 +90,7 @@ def parse_source(source)
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def autocorrect_source(cop, source)
|
93
|
-
cop.autocorrect = true
|
93
|
+
cop.instance_variable_get(:@options)[:autocorrect] = true
|
94
94
|
processed_source = parse_source(source)
|
95
95
|
|
96
96
|
_investigate(cop, processed_source)
|
@@ -110,6 +110,10 @@ class Rubocop::Cop::Cop
|
|
110
110
|
def messages
|
111
111
|
offences.map(&:message)
|
112
112
|
end
|
113
|
+
|
114
|
+
def highlights
|
115
|
+
offences.sort_by(&:line).map { |o| o.location.source }
|
116
|
+
end
|
113
117
|
end
|
114
118
|
|
115
119
|
# Requires supporting files with custom matchers and macros, etc,
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module ASTHelper
|
4
|
+
def scan_node(node, options = {}, &block)
|
5
|
+
yield node if options[:include_origin_node]
|
6
|
+
|
7
|
+
node.children.each do |child|
|
8
|
+
next unless child.is_a?(Parser::AST::Node)
|
9
|
+
yield child
|
10
|
+
scan_node(child, &block)
|
11
|
+
end
|
12
|
+
|
13
|
+
nil
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# `cop_config` must be declared with #let.
|
4
|
+
shared_context 'config', :config do
|
5
|
+
let(:config) do
|
6
|
+
# Module#<
|
7
|
+
unless described_class < Rubocop::Cop::Cop
|
8
|
+
fail '`config` must be used in `describe SomeCopClass do .. end`'
|
9
|
+
end
|
10
|
+
|
11
|
+
unless cop_config.is_a?(Hash)
|
12
|
+
fail '`cop_config` must be declared with #let'
|
13
|
+
end
|
14
|
+
|
15
|
+
hash = { described_class.cop_name => cop_config }
|
16
|
+
Rubocop::Config.new(hash)
|
17
|
+
end
|
18
|
+
end
|
@@ -22,7 +22,7 @@ shared_examples_for 'mimics MRI 2.0' do |grep_mri_warning|
|
|
22
22
|
offence_by_mri = offences_by_mri[index]
|
23
23
|
# Exclude column attribute since MRI does not
|
24
24
|
# output column number.
|
25
|
-
[:severity, :line, :cop_name
|
25
|
+
[:severity, :line, :cop_name].each do |a|
|
26
26
|
expect(offence_by_cop.send(a)).to eq(offence_by_mri.send(a))
|
27
27
|
end
|
28
28
|
end
|
metadata
CHANGED
@@ -1,32 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Bozhidar Batsov
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-
|
12
|
+
date: 2013-09-13 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rainbow
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- - '>='
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: 1.1.4
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- - '>='
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 1.1.4
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: parser
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
35
|
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -41,6 +46,7 @@ dependencies:
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: backports
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
51
|
- - ~>
|
46
52
|
- !ruby/object:Gem::Version
|
@@ -48,6 +54,7 @@ dependencies:
|
|
48
54
|
type: :runtime
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
59
|
- - ~>
|
53
60
|
- !ruby/object:Gem::Version
|
@@ -55,20 +62,23 @@ dependencies:
|
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: powerpack
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
67
|
- - ~>
|
60
68
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.0.
|
69
|
+
version: 0.0.6
|
62
70
|
type: :runtime
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
75
|
- - ~>
|
67
76
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.0.
|
77
|
+
version: 0.0.6
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: rake
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
83
|
- - ~>
|
74
84
|
- !ruby/object:Gem::Version
|
@@ -76,6 +86,7 @@ dependencies:
|
|
76
86
|
type: :development
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
91
|
- - ~>
|
81
92
|
- !ruby/object:Gem::Version
|
@@ -83,6 +94,7 @@ dependencies:
|
|
83
94
|
- !ruby/object:Gem::Dependency
|
84
95
|
name: rspec
|
85
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
86
98
|
requirements:
|
87
99
|
- - ~>
|
88
100
|
- !ruby/object:Gem::Version
|
@@ -90,6 +102,7 @@ dependencies:
|
|
90
102
|
type: :development
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
93
106
|
requirements:
|
94
107
|
- - ~>
|
95
108
|
- !ruby/object:Gem::Version
|
@@ -97,6 +110,7 @@ dependencies:
|
|
97
110
|
- !ruby/object:Gem::Dependency
|
98
111
|
name: yard
|
99
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
100
114
|
requirements:
|
101
115
|
- - ~>
|
102
116
|
- !ruby/object:Gem::Version
|
@@ -104,6 +118,7 @@ dependencies:
|
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
107
122
|
requirements:
|
108
123
|
- - ~>
|
109
124
|
- !ruby/object:Gem::Version
|
@@ -111,6 +126,7 @@ dependencies:
|
|
111
126
|
- !ruby/object:Gem::Dependency
|
112
127
|
name: bundler
|
113
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
114
130
|
requirements:
|
115
131
|
- - ~>
|
116
132
|
- !ruby/object:Gem::Version
|
@@ -118,6 +134,7 @@ dependencies:
|
|
118
134
|
type: :development
|
119
135
|
prerelease: false
|
120
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
121
138
|
requirements:
|
122
139
|
- - ~>
|
123
140
|
- !ruby/object:Gem::Version
|
@@ -125,6 +142,7 @@ dependencies:
|
|
125
142
|
- !ruby/object:Gem::Dependency
|
126
143
|
name: simplecov
|
127
144
|
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
128
146
|
requirements:
|
129
147
|
- - ~>
|
130
148
|
- !ruby/object:Gem::Version
|
@@ -132,13 +150,13 @@ dependencies:
|
|
132
150
|
type: :development
|
133
151
|
prerelease: false
|
134
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
135
154
|
requirements:
|
136
155
|
- - ~>
|
137
156
|
- !ruby/object:Gem::Version
|
138
157
|
version: '0.7'
|
139
|
-
description:
|
140
|
-
|
141
|
-
Aims to enforce the community-driven Ruby Style Guide.
|
158
|
+
description: ! " Automatic Ruby code style checking tool.\n Aims to enforce
|
159
|
+
the community-driven Ruby Style Guide.\n"
|
142
160
|
email: bozhidar@batsov.com
|
143
161
|
executables:
|
144
162
|
- rubocop
|
@@ -183,9 +201,9 @@ files:
|
|
183
201
|
- lib/rubocop/cop/lint/rescue_exception.rb
|
184
202
|
- lib/rubocop/cop/lint/shadowing_outer_local_variable.rb
|
185
203
|
- lib/rubocop/cop/lint/unreachable_code.rb
|
186
|
-
- lib/rubocop/cop/lint/unused_local_variable.rb
|
187
204
|
- lib/rubocop/cop/lint/useless_assignment.rb
|
188
205
|
- lib/rubocop/cop/lint/useless_comparison.rb
|
206
|
+
- lib/rubocop/cop/lint/useless_setter_call.rb
|
189
207
|
- lib/rubocop/cop/lint/void.rb
|
190
208
|
- lib/rubocop/cop/offence.rb
|
191
209
|
- lib/rubocop/cop/rails/has_and_belongs_to_many.rb
|
@@ -193,16 +211,13 @@ files:
|
|
193
211
|
- lib/rubocop/cop/rails/validation.rb
|
194
212
|
- lib/rubocop/cop/style/access_control.rb
|
195
213
|
- lib/rubocop/cop/style/alias.rb
|
214
|
+
- lib/rubocop/cop/style/align_array.rb
|
215
|
+
- lib/rubocop/cop/style/align_hash.rb
|
196
216
|
- lib/rubocop/cop/style/align_parameters.rb
|
197
217
|
- lib/rubocop/cop/style/and_or.rb
|
198
218
|
- lib/rubocop/cop/style/ascii_comments.rb
|
199
219
|
- lib/rubocop/cop/style/ascii_identifiers.rb
|
200
220
|
- lib/rubocop/cop/style/attr.rb
|
201
|
-
- lib/rubocop/cop/style/avoid_class_vars.rb
|
202
|
-
- lib/rubocop/cop/style/avoid_for.rb
|
203
|
-
- lib/rubocop/cop/style/avoid_global_vars.rb
|
204
|
-
- lib/rubocop/cop/style/avoid_perl_backrefs.rb
|
205
|
-
- lib/rubocop/cop/style/avoid_perlisms.rb
|
206
221
|
- lib/rubocop/cop/style/begin_block.rb
|
207
222
|
- lib/rubocop/cop/style/block_comments.rb
|
208
223
|
- lib/rubocop/cop/style/block_nesting.rb
|
@@ -212,6 +227,7 @@ files:
|
|
212
227
|
- lib/rubocop/cop/style/character_literal.rb
|
213
228
|
- lib/rubocop/cop/style/class_and_module_camel_case.rb
|
214
229
|
- lib/rubocop/cop/style/class_methods.rb
|
230
|
+
- lib/rubocop/cop/style/class_vars.rb
|
215
231
|
- lib/rubocop/cop/style/collection_methods.rb
|
216
232
|
- lib/rubocop/cop/style/colon_method_call.rb
|
217
233
|
- lib/rubocop/cop/style/comment_annotation.rb
|
@@ -230,6 +246,9 @@ files:
|
|
230
246
|
- lib/rubocop/cop/style/favor_modifier.rb
|
231
247
|
- lib/rubocop/cop/style/favor_sprintf.rb
|
232
248
|
- lib/rubocop/cop/style/favor_unless_over_negated_if.rb
|
249
|
+
- lib/rubocop/cop/style/final_newline.rb
|
250
|
+
- lib/rubocop/cop/style/for.rb
|
251
|
+
- lib/rubocop/cop/style/global_vars.rb
|
233
252
|
- lib/rubocop/cop/style/hash_methods.rb
|
234
253
|
- lib/rubocop/cop/style/hash_syntax.rb
|
235
254
|
- lib/rubocop/cop/style/if_then_else.rb
|
@@ -242,6 +261,7 @@ files:
|
|
242
261
|
- lib/rubocop/cop/style/method_call_parentheses.rb
|
243
262
|
- lib/rubocop/cop/style/method_length.rb
|
244
263
|
- lib/rubocop/cop/style/module_function.rb
|
264
|
+
- lib/rubocop/cop/style/multiline_block_chain.rb
|
245
265
|
- lib/rubocop/cop/style/multiline_if_then.rb
|
246
266
|
- lib/rubocop/cop/style/nil_comparison.rb
|
247
267
|
- lib/rubocop/cop/style/not.rb
|
@@ -250,6 +270,7 @@ files:
|
|
250
270
|
- lib/rubocop/cop/style/op_method.rb
|
251
271
|
- lib/rubocop/cop/style/parameter_lists.rb
|
252
272
|
- lib/rubocop/cop/style/parentheses_around_condition.rb
|
273
|
+
- lib/rubocop/cop/style/perl_backrefs.rb
|
253
274
|
- lib/rubocop/cop/style/proc.rb
|
254
275
|
- lib/rubocop/cop/style/reduce_arguments.rb
|
255
276
|
- lib/rubocop/cop/style/redundant_begin.rb
|
@@ -263,12 +284,15 @@ files:
|
|
263
284
|
- lib/rubocop/cop/style/space_after_comma_etc.rb
|
264
285
|
- lib/rubocop/cop/style/space_after_control_keyword.rb
|
265
286
|
- lib/rubocop/cop/style/space_after_method_name.rb
|
287
|
+
- lib/rubocop/cop/style/space_before_modifier_keyword.rb
|
288
|
+
- lib/rubocop/cop/style/special_global_vars.rb
|
266
289
|
- lib/rubocop/cop/style/string_literals.rb
|
267
290
|
- lib/rubocop/cop/style/surrounding_space.rb
|
268
291
|
- lib/rubocop/cop/style/symbol_array.rb
|
269
292
|
- lib/rubocop/cop/style/symbol_name.rb
|
270
293
|
- lib/rubocop/cop/style/tab.rb
|
271
294
|
- lib/rubocop/cop/style/ternary_operator.rb
|
295
|
+
- lib/rubocop/cop/style/trailing_blank_lines.rb
|
272
296
|
- lib/rubocop/cop/style/trailing_whitespace.rb
|
273
297
|
- lib/rubocop/cop/style/trivial_accessors.rb
|
274
298
|
- lib/rubocop/cop/style/unless_else.rb
|
@@ -276,8 +300,15 @@ files:
|
|
276
300
|
- lib/rubocop/cop/style/when_then.rb
|
277
301
|
- lib/rubocop/cop/style/while_until_do.rb
|
278
302
|
- lib/rubocop/cop/style/word_array.rb
|
303
|
+
- lib/rubocop/cop/team.rb
|
279
304
|
- lib/rubocop/cop/util.rb
|
280
305
|
- lib/rubocop/cop/variable_inspector.rb
|
306
|
+
- lib/rubocop/cop/variable_inspector/assignment.rb
|
307
|
+
- lib/rubocop/cop/variable_inspector/locatable.rb
|
308
|
+
- lib/rubocop/cop/variable_inspector/reference.rb
|
309
|
+
- lib/rubocop/cop/variable_inspector/scope.rb
|
310
|
+
- lib/rubocop/cop/variable_inspector/variable.rb
|
311
|
+
- lib/rubocop/cop/variable_inspector/variable_table.rb
|
281
312
|
- lib/rubocop/formatter/base_formatter.rb
|
282
313
|
- lib/rubocop/formatter/clang_style_formatter.rb
|
283
314
|
- lib/rubocop/formatter/disabled_config_formatter.rb
|
@@ -317,9 +348,9 @@ files:
|
|
317
348
|
- spec/rubocop/cop/lint/rescue_exception_spec.rb
|
318
349
|
- spec/rubocop/cop/lint/shadowing_outer_local_variable_spec.rb
|
319
350
|
- spec/rubocop/cop/lint/unreachable_code_spec.rb
|
320
|
-
- spec/rubocop/cop/lint/unused_local_variable_spec.rb
|
321
351
|
- spec/rubocop/cop/lint/useless_assignment_spec.rb
|
322
352
|
- spec/rubocop/cop/lint/useless_comparison_spec.rb
|
353
|
+
- spec/rubocop/cop/lint/useless_setter_call_spec.rb
|
323
354
|
- spec/rubocop/cop/lint/void_spec.rb
|
324
355
|
- spec/rubocop/cop/offence_spec.rb
|
325
356
|
- spec/rubocop/cop/rails/has_and_belongs_to_many_spec.rb
|
@@ -327,16 +358,13 @@ files:
|
|
327
358
|
- spec/rubocop/cop/rails/validation_spec.rb
|
328
359
|
- spec/rubocop/cop/style/access_control_spec.rb
|
329
360
|
- spec/rubocop/cop/style/alias_spec.rb
|
361
|
+
- spec/rubocop/cop/style/align_array_spec.rb
|
362
|
+
- spec/rubocop/cop/style/align_hash_spec.rb
|
330
363
|
- spec/rubocop/cop/style/align_parameters_spec.rb
|
331
364
|
- spec/rubocop/cop/style/and_or_spec.rb
|
332
365
|
- spec/rubocop/cop/style/ascii_comments_spec.rb
|
333
366
|
- spec/rubocop/cop/style/ascii_identifiers_spec.rb
|
334
367
|
- spec/rubocop/cop/style/attr_spec.rb
|
335
|
-
- spec/rubocop/cop/style/avoid_class_vars_spec.rb
|
336
|
-
- spec/rubocop/cop/style/avoid_for_spec.rb
|
337
|
-
- spec/rubocop/cop/style/avoid_global_vars_spec.rb
|
338
|
-
- spec/rubocop/cop/style/avoid_perl_backrefs_spec.rb
|
339
|
-
- spec/rubocop/cop/style/avoid_perlisms_spec.rb
|
340
368
|
- spec/rubocop/cop/style/begin_block_spec.rb
|
341
369
|
- spec/rubocop/cop/style/block_comments_spec.rb
|
342
370
|
- spec/rubocop/cop/style/block_nesting_spec.rb
|
@@ -346,6 +374,7 @@ files:
|
|
346
374
|
- spec/rubocop/cop/style/character_literal_spec.rb
|
347
375
|
- spec/rubocop/cop/style/class_and_module_camel_case_spec.rb
|
348
376
|
- spec/rubocop/cop/style/class_methods_spec.rb
|
377
|
+
- spec/rubocop/cop/style/class_vars_spec.rb
|
349
378
|
- spec/rubocop/cop/style/collection_methods_spec.rb
|
350
379
|
- spec/rubocop/cop/style/colon_method_call_spec.rb
|
351
380
|
- spec/rubocop/cop/style/comment_annotation_spec.rb
|
@@ -366,6 +395,9 @@ files:
|
|
366
395
|
- spec/rubocop/cop/style/favor_sprintf_spec.rb
|
367
396
|
- spec/rubocop/cop/style/favor_unless_over_negated_if_spec.rb
|
368
397
|
- spec/rubocop/cop/style/favor_until_over_negated_while_spec.rb
|
398
|
+
- spec/rubocop/cop/style/final_newline_spec.rb
|
399
|
+
- spec/rubocop/cop/style/for_spec.rb
|
400
|
+
- spec/rubocop/cop/style/global_vars_spec.rb
|
369
401
|
- spec/rubocop/cop/style/hash_methods_spec.rb
|
370
402
|
- spec/rubocop/cop/style/hash_syntax_spec.rb
|
371
403
|
- spec/rubocop/cop/style/if_with_semicolon_spec.rb
|
@@ -377,6 +409,7 @@ files:
|
|
377
409
|
- spec/rubocop/cop/style/method_call_parentheses_spec.rb
|
378
410
|
- spec/rubocop/cop/style/method_length_spec.rb
|
379
411
|
- spec/rubocop/cop/style/module_function_spec.rb
|
412
|
+
- spec/rubocop/cop/style/multiline_block_chain_spec.rb
|
380
413
|
- spec/rubocop/cop/style/multiline_if_then_spec.rb
|
381
414
|
- spec/rubocop/cop/style/nil_comparison_spec.rb
|
382
415
|
- spec/rubocop/cop/style/not_spec.rb
|
@@ -385,6 +418,7 @@ files:
|
|
385
418
|
- spec/rubocop/cop/style/op_method_spec.rb
|
386
419
|
- spec/rubocop/cop/style/parameter_lists_spec.rb
|
387
420
|
- spec/rubocop/cop/style/parentheses_around_condition_spec.rb
|
421
|
+
- spec/rubocop/cop/style/perl_backrefs_spec.rb
|
388
422
|
- spec/rubocop/cop/style/proc_spec.rb
|
389
423
|
- spec/rubocop/cop/style/reduce_arguments_spec.rb
|
390
424
|
- spec/rubocop/cop/style/redundant_begin_spec.rb
|
@@ -403,14 +437,17 @@ files:
|
|
403
437
|
- spec/rubocop/cop/style/space_around_braces_spec.rb
|
404
438
|
- spec/rubocop/cop/style/space_around_equals_in_default_parameter_spec.rb
|
405
439
|
- spec/rubocop/cop/style/space_around_operators_spec.rb
|
440
|
+
- spec/rubocop/cop/style/space_before_modifier_keyword_spec.rb
|
406
441
|
- spec/rubocop/cop/style/space_inside_brackets_spec.rb
|
407
442
|
- spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb
|
408
443
|
- spec/rubocop/cop/style/space_inside_parens_spec.rb
|
444
|
+
- spec/rubocop/cop/style/special_global_vars_spec.rb
|
409
445
|
- spec/rubocop/cop/style/string_literals_spec.rb
|
410
446
|
- spec/rubocop/cop/style/symbol_array_spec.rb
|
411
447
|
- spec/rubocop/cop/style/symbol_name_spec.rb
|
412
448
|
- spec/rubocop/cop/style/tab_spec.rb
|
413
449
|
- spec/rubocop/cop/style/ternary_operator_spec.rb
|
450
|
+
- spec/rubocop/cop/style/trailing_blank_lines_spec.rb
|
414
451
|
- spec/rubocop/cop/style/trailing_whitespace_spec.rb
|
415
452
|
- spec/rubocop/cop/style/trivial_accessors_spec.rb
|
416
453
|
- spec/rubocop/cop/style/unless_else_spec.rb
|
@@ -418,6 +455,12 @@ files:
|
|
418
455
|
- spec/rubocop/cop/style/when_then_spec.rb
|
419
456
|
- spec/rubocop/cop/style/while_until_do_spec.rb
|
420
457
|
- spec/rubocop/cop/style/word_array_spec.rb
|
458
|
+
- spec/rubocop/cop/team_spec.rb
|
459
|
+
- spec/rubocop/cop/variable_inspector/assignment_spec.rb
|
460
|
+
- spec/rubocop/cop/variable_inspector/locatable_spec.rb
|
461
|
+
- spec/rubocop/cop/variable_inspector/scope_spec.rb
|
462
|
+
- spec/rubocop/cop/variable_inspector/variable_spec.rb
|
463
|
+
- spec/rubocop/cop/variable_inspector/variable_table_spec.rb
|
421
464
|
- spec/rubocop/cop/variable_inspector_spec.rb
|
422
465
|
- spec/rubocop/formatter/base_formatter_spec.rb
|
423
466
|
- spec/rubocop/formatter/clang_style_formatter_spec.rb
|
@@ -434,33 +477,39 @@ files:
|
|
434
477
|
- spec/rubocop/target_finder_spec.rb
|
435
478
|
- spec/rubocop/token_spec.rb
|
436
479
|
- spec/spec_helper.rb
|
480
|
+
- spec/support/ast_helper.rb
|
437
481
|
- spec/support/file_helper.rb
|
438
482
|
- spec/support/isolated_environment.rb
|
439
483
|
- spec/support/mri_syntax_checker.rb
|
484
|
+
- spec/support/shared_context.rb
|
440
485
|
- spec/support/shared_examples.rb
|
441
486
|
homepage: http://github.com/bbatsov/rubocop
|
442
487
|
licenses:
|
443
488
|
- MIT
|
444
|
-
metadata: {}
|
445
489
|
post_install_message:
|
446
490
|
rdoc_options: []
|
447
491
|
require_paths:
|
448
492
|
- lib
|
449
493
|
required_ruby_version: !ruby/object:Gem::Requirement
|
494
|
+
none: false
|
450
495
|
requirements:
|
451
|
-
- - '>='
|
496
|
+
- - ! '>='
|
452
497
|
- !ruby/object:Gem::Version
|
453
498
|
version: 1.9.2
|
454
499
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
500
|
+
none: false
|
455
501
|
requirements:
|
456
|
-
- - '>='
|
502
|
+
- - ! '>='
|
457
503
|
- !ruby/object:Gem::Version
|
458
504
|
version: '0'
|
505
|
+
segments:
|
506
|
+
- 0
|
507
|
+
hash: 1613549233973798882
|
459
508
|
requirements: []
|
460
509
|
rubyforge_project:
|
461
|
-
rubygems_version:
|
510
|
+
rubygems_version: 1.8.23
|
462
511
|
signing_key:
|
463
|
-
specification_version:
|
512
|
+
specification_version: 3
|
464
513
|
summary: Automatic Ruby code style checking tool.
|
465
514
|
test_files:
|
466
515
|
- spec/.rubocop.yml
|
@@ -485,9 +534,9 @@ test_files:
|
|
485
534
|
- spec/rubocop/cop/lint/rescue_exception_spec.rb
|
486
535
|
- spec/rubocop/cop/lint/shadowing_outer_local_variable_spec.rb
|
487
536
|
- spec/rubocop/cop/lint/unreachable_code_spec.rb
|
488
|
-
- spec/rubocop/cop/lint/unused_local_variable_spec.rb
|
489
537
|
- spec/rubocop/cop/lint/useless_assignment_spec.rb
|
490
538
|
- spec/rubocop/cop/lint/useless_comparison_spec.rb
|
539
|
+
- spec/rubocop/cop/lint/useless_setter_call_spec.rb
|
491
540
|
- spec/rubocop/cop/lint/void_spec.rb
|
492
541
|
- spec/rubocop/cop/offence_spec.rb
|
493
542
|
- spec/rubocop/cop/rails/has_and_belongs_to_many_spec.rb
|
@@ -495,16 +544,13 @@ test_files:
|
|
495
544
|
- spec/rubocop/cop/rails/validation_spec.rb
|
496
545
|
- spec/rubocop/cop/style/access_control_spec.rb
|
497
546
|
- spec/rubocop/cop/style/alias_spec.rb
|
547
|
+
- spec/rubocop/cop/style/align_array_spec.rb
|
548
|
+
- spec/rubocop/cop/style/align_hash_spec.rb
|
498
549
|
- spec/rubocop/cop/style/align_parameters_spec.rb
|
499
550
|
- spec/rubocop/cop/style/and_or_spec.rb
|
500
551
|
- spec/rubocop/cop/style/ascii_comments_spec.rb
|
501
552
|
- spec/rubocop/cop/style/ascii_identifiers_spec.rb
|
502
553
|
- spec/rubocop/cop/style/attr_spec.rb
|
503
|
-
- spec/rubocop/cop/style/avoid_class_vars_spec.rb
|
504
|
-
- spec/rubocop/cop/style/avoid_for_spec.rb
|
505
|
-
- spec/rubocop/cop/style/avoid_global_vars_spec.rb
|
506
|
-
- spec/rubocop/cop/style/avoid_perl_backrefs_spec.rb
|
507
|
-
- spec/rubocop/cop/style/avoid_perlisms_spec.rb
|
508
554
|
- spec/rubocop/cop/style/begin_block_spec.rb
|
509
555
|
- spec/rubocop/cop/style/block_comments_spec.rb
|
510
556
|
- spec/rubocop/cop/style/block_nesting_spec.rb
|
@@ -514,6 +560,7 @@ test_files:
|
|
514
560
|
- spec/rubocop/cop/style/character_literal_spec.rb
|
515
561
|
- spec/rubocop/cop/style/class_and_module_camel_case_spec.rb
|
516
562
|
- spec/rubocop/cop/style/class_methods_spec.rb
|
563
|
+
- spec/rubocop/cop/style/class_vars_spec.rb
|
517
564
|
- spec/rubocop/cop/style/collection_methods_spec.rb
|
518
565
|
- spec/rubocop/cop/style/colon_method_call_spec.rb
|
519
566
|
- spec/rubocop/cop/style/comment_annotation_spec.rb
|
@@ -534,6 +581,9 @@ test_files:
|
|
534
581
|
- spec/rubocop/cop/style/favor_sprintf_spec.rb
|
535
582
|
- spec/rubocop/cop/style/favor_unless_over_negated_if_spec.rb
|
536
583
|
- spec/rubocop/cop/style/favor_until_over_negated_while_spec.rb
|
584
|
+
- spec/rubocop/cop/style/final_newline_spec.rb
|
585
|
+
- spec/rubocop/cop/style/for_spec.rb
|
586
|
+
- spec/rubocop/cop/style/global_vars_spec.rb
|
537
587
|
- spec/rubocop/cop/style/hash_methods_spec.rb
|
538
588
|
- spec/rubocop/cop/style/hash_syntax_spec.rb
|
539
589
|
- spec/rubocop/cop/style/if_with_semicolon_spec.rb
|
@@ -545,6 +595,7 @@ test_files:
|
|
545
595
|
- spec/rubocop/cop/style/method_call_parentheses_spec.rb
|
546
596
|
- spec/rubocop/cop/style/method_length_spec.rb
|
547
597
|
- spec/rubocop/cop/style/module_function_spec.rb
|
598
|
+
- spec/rubocop/cop/style/multiline_block_chain_spec.rb
|
548
599
|
- spec/rubocop/cop/style/multiline_if_then_spec.rb
|
549
600
|
- spec/rubocop/cop/style/nil_comparison_spec.rb
|
550
601
|
- spec/rubocop/cop/style/not_spec.rb
|
@@ -553,6 +604,7 @@ test_files:
|
|
553
604
|
- spec/rubocop/cop/style/op_method_spec.rb
|
554
605
|
- spec/rubocop/cop/style/parameter_lists_spec.rb
|
555
606
|
- spec/rubocop/cop/style/parentheses_around_condition_spec.rb
|
607
|
+
- spec/rubocop/cop/style/perl_backrefs_spec.rb
|
556
608
|
- spec/rubocop/cop/style/proc_spec.rb
|
557
609
|
- spec/rubocop/cop/style/reduce_arguments_spec.rb
|
558
610
|
- spec/rubocop/cop/style/redundant_begin_spec.rb
|
@@ -571,14 +623,17 @@ test_files:
|
|
571
623
|
- spec/rubocop/cop/style/space_around_braces_spec.rb
|
572
624
|
- spec/rubocop/cop/style/space_around_equals_in_default_parameter_spec.rb
|
573
625
|
- spec/rubocop/cop/style/space_around_operators_spec.rb
|
626
|
+
- spec/rubocop/cop/style/space_before_modifier_keyword_spec.rb
|
574
627
|
- spec/rubocop/cop/style/space_inside_brackets_spec.rb
|
575
628
|
- spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb
|
576
629
|
- spec/rubocop/cop/style/space_inside_parens_spec.rb
|
630
|
+
- spec/rubocop/cop/style/special_global_vars_spec.rb
|
577
631
|
- spec/rubocop/cop/style/string_literals_spec.rb
|
578
632
|
- spec/rubocop/cop/style/symbol_array_spec.rb
|
579
633
|
- spec/rubocop/cop/style/symbol_name_spec.rb
|
580
634
|
- spec/rubocop/cop/style/tab_spec.rb
|
581
635
|
- spec/rubocop/cop/style/ternary_operator_spec.rb
|
636
|
+
- spec/rubocop/cop/style/trailing_blank_lines_spec.rb
|
582
637
|
- spec/rubocop/cop/style/trailing_whitespace_spec.rb
|
583
638
|
- spec/rubocop/cop/style/trivial_accessors_spec.rb
|
584
639
|
- spec/rubocop/cop/style/unless_else_spec.rb
|
@@ -586,6 +641,12 @@ test_files:
|
|
586
641
|
- spec/rubocop/cop/style/when_then_spec.rb
|
587
642
|
- spec/rubocop/cop/style/while_until_do_spec.rb
|
588
643
|
- spec/rubocop/cop/style/word_array_spec.rb
|
644
|
+
- spec/rubocop/cop/team_spec.rb
|
645
|
+
- spec/rubocop/cop/variable_inspector/assignment_spec.rb
|
646
|
+
- spec/rubocop/cop/variable_inspector/locatable_spec.rb
|
647
|
+
- spec/rubocop/cop/variable_inspector/scope_spec.rb
|
648
|
+
- spec/rubocop/cop/variable_inspector/variable_spec.rb
|
649
|
+
- spec/rubocop/cop/variable_inspector/variable_table_spec.rb
|
589
650
|
- spec/rubocop/cop/variable_inspector_spec.rb
|
590
651
|
- spec/rubocop/formatter/base_formatter_spec.rb
|
591
652
|
- spec/rubocop/formatter/clang_style_formatter_spec.rb
|
@@ -602,8 +663,10 @@ test_files:
|
|
602
663
|
- spec/rubocop/target_finder_spec.rb
|
603
664
|
- spec/rubocop/token_spec.rb
|
604
665
|
- spec/spec_helper.rb
|
666
|
+
- spec/support/ast_helper.rb
|
605
667
|
- spec/support/file_helper.rb
|
606
668
|
- spec/support/isolated_environment.rb
|
607
669
|
- spec/support/mri_syntax_checker.rb
|
670
|
+
- spec/support/shared_context.rb
|
608
671
|
- spec/support/shared_examples.rb
|
609
672
|
has_rdoc:
|