rubocop 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rubocop might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +3 -1
- data/CHANGELOG.md +44 -0
- data/CONTRIBUTING.md +40 -8
- data/Gemfile +6 -0
- data/README.md +65 -20
- data/Rakefile +0 -1
- data/config/default.yml +15 -3
- data/config/enabled.yml +143 -109
- data/lib/rubocop.rb +45 -26
- data/lib/rubocop/cli.rb +26 -27
- data/lib/rubocop/config.rb +0 -1
- data/lib/rubocop/config_loader.rb +16 -23
- data/lib/rubocop/cop/commissioner.rb +2 -7
- data/lib/rubocop/cop/cop.rb +24 -51
- data/lib/rubocop/cop/ignored_node.rb +31 -0
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +50 -0
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +36 -0
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +3 -11
- data/lib/rubocop/cop/lint/block_alignment.rb +6 -20
- data/lib/rubocop/cop/lint/condition_position.rb +52 -0
- data/lib/rubocop/cop/lint/else_layout.rb +57 -0
- data/lib/rubocop/cop/lint/end_alignment.rb +33 -8
- data/lib/rubocop/cop/lint/invalid_character_literal.rb +37 -0
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +2 -4
- data/lib/rubocop/cop/lint/syntax.rb +6 -12
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +25 -0
- data/lib/rubocop/cop/mixin/array_syntax.rb +20 -0
- data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +76 -0
- data/lib/rubocop/cop/mixin/check_assignment.rb +26 -0
- data/lib/rubocop/cop/{check_methods.rb → mixin/check_methods.rb} +0 -0
- data/lib/rubocop/cop/mixin/code_length.rb +33 -0
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +53 -0
- data/lib/rubocop/cop/mixin/configurable_max.rb +19 -0
- data/lib/rubocop/cop/mixin/configurable_naming.rb +45 -0
- data/lib/rubocop/cop/{style → mixin}/if_node.rb +0 -0
- data/lib/rubocop/cop/mixin/if_then_else.rb +23 -0
- data/lib/rubocop/cop/mixin/negative_conditional.rb +24 -0
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +34 -0
- data/lib/rubocop/cop/mixin/safe_assignment.rb +19 -0
- data/lib/rubocop/cop/mixin/space_after_punctuation.rb +32 -0
- data/lib/rubocop/cop/mixin/space_inside.rb +31 -0
- data/lib/rubocop/cop/mixin/statement_modifier.rb +59 -0
- data/lib/rubocop/cop/mixin/string_help.rb +32 -0
- data/lib/rubocop/cop/mixin/surrounding_space.rb +42 -0
- data/lib/rubocop/cop/rails/default_scope.rb +3 -1
- data/lib/rubocop/cop/style/accessor_method_name.rb +4 -12
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +16 -1
- data/lib/rubocop/cop/style/case_indentation.rb +33 -16
- data/lib/rubocop/cop/style/character_literal.rb +10 -0
- data/lib/rubocop/cop/style/dot_position.rb +23 -6
- data/lib/rubocop/cop/style/empty_lines_around_body.rb +5 -5
- data/lib/rubocop/cop/style/favor_unless_over_negated_if.rb +1 -32
- data/lib/rubocop/cop/style/favor_until_over_negated_while.rb +20 -0
- data/lib/rubocop/cop/style/hash_syntax.rb +5 -1
- data/lib/rubocop/cop/style/if_unless_modifier.rb +34 -0
- data/lib/rubocop/cop/style/if_with_semicolon.rb +1 -1
- data/lib/rubocop/cop/style/indentation_consistency.rb +51 -0
- data/lib/rubocop/cop/style/indentation_width.rb +0 -26
- data/lib/rubocop/cop/style/lambda_call.rb +12 -5
- data/lib/rubocop/cop/style/method_def_parentheses.rb +29 -11
- data/lib/rubocop/cop/style/multiline_if_then.rb +4 -9
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +22 -0
- data/lib/rubocop/cop/style/{ternary_operator.rb → nested_ternary_operator.rb} +0 -15
- data/lib/rubocop/cop/style/numeric_literals.rb +30 -2
- data/lib/rubocop/cop/style/one_line_conditional.rb +2 -1
- data/lib/rubocop/cop/style/parameter_lists.rb +7 -3
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +9 -11
- data/lib/rubocop/cop/style/predicate_name.rb +4 -12
- data/lib/rubocop/cop/style/raise_args.rb +19 -11
- data/lib/rubocop/cop/style/regexp_literal.rb +19 -6
- data/lib/rubocop/cop/style/space_after_colon.rb +36 -0
- data/lib/rubocop/cop/style/space_after_comma.rb +16 -0
- data/lib/rubocop/cop/style/space_after_semicolon.rb +16 -0
- data/lib/rubocop/cop/style/space_around_block_braces.rb +38 -38
- data/lib/rubocop/cop/style/space_around_operators.rb +1 -2
- data/lib/rubocop/cop/style/space_inside_hash_literal_braces.rb +6 -2
- data/lib/rubocop/cop/style/string_literals.rb +5 -5
- data/lib/rubocop/cop/style/trailing_comma.rb +94 -0
- data/lib/rubocop/cop/style/unless_else.rb +2 -2
- data/lib/rubocop/cop/style/while_until_modifier.rb +32 -0
- data/lib/rubocop/cop/style/word_array.rb +9 -1
- data/lib/rubocop/cop/util.rb +14 -0
- data/lib/rubocop/cop/variable_inspector.rb +11 -6
- data/lib/rubocop/cop/variable_inspector/scope.rb +4 -3
- data/lib/rubocop/file_inspector.rb +22 -6
- data/lib/rubocop/formatter/clang_style_formatter.rb +1 -1
- data/lib/rubocop/formatter/colorizable.rb +37 -0
- data/lib/rubocop/formatter/disabled_config_formatter.rb +27 -6
- data/lib/rubocop/formatter/progress_formatter.rb +1 -1
- data/lib/rubocop/formatter/simple_text_formatter.rb +9 -5
- data/lib/rubocop/options.rb +19 -4
- data/lib/rubocop/target_finder.rb +4 -0
- data/lib/rubocop/version.rb +1 -1
- data/rubocop-todo.yml +10 -2
- data/rubocop.gemspec +3 -2
- data/spec/project_spec.rb +12 -7
- data/spec/rubocop/cli_spec.rb +262 -99
- data/spec/rubocop/config_loader_spec.rb +5 -5
- data/spec/rubocop/config_spec.rb +3 -3
- data/spec/rubocop/config_store_spec.rb +12 -11
- data/spec/rubocop/cop/commissioner_spec.rb +21 -5
- data/spec/rubocop/cop/cop_spec.rb +1 -1
- data/spec/rubocop/cop/lint/ambiguous_operator_spec.rb +113 -0
- data/spec/rubocop/cop/lint/ambiguous_regexp_literal_spec.rb +35 -0
- data/spec/rubocop/cop/lint/block_alignment_spec.rb +2 -2
- data/spec/rubocop/cop/lint/condition_position_spec.rb +49 -0
- data/spec/rubocop/cop/lint/else_layout_spec.rb +65 -0
- data/spec/rubocop/cop/lint/end_alignment_spec.rb +41 -1
- data/spec/rubocop/cop/lint/invalid_character_literal_spec.rb +33 -0
- data/spec/rubocop/cop/lint/parentheses_as_grouped_expression_spec.rb +3 -3
- data/spec/rubocop/cop/lint/shadowing_outer_local_variable_spec.rb +12 -12
- data/spec/rubocop/cop/lint/syntax_spec.rb +2 -2
- data/spec/rubocop/cop/lint/useless_assignment_spec.rb +72 -54
- data/spec/rubocop/cop/lint/useless_else_without_rescue_spec.rb +48 -0
- data/spec/rubocop/cop/offence_spec.rb +1 -1
- data/spec/rubocop/cop/rails/default_scope_spec.rb +6 -0
- data/spec/rubocop/cop/rails/output_spec.rb +2 -1
- data/spec/rubocop/cop/style/align_hash_spec.rb +9 -9
- data/spec/rubocop/cop/style/align_parameters_spec.rb +1 -1
- data/spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb +5 -0
- data/spec/rubocop/cop/style/case_indentation_spec.rb +53 -2
- data/spec/rubocop/cop/style/class_and_module_camel_case_spec.rb +3 -3
- data/spec/rubocop/cop/style/documentation_spec.rb +0 -1
- data/spec/rubocop/cop/style/dot_position_spec.rb +18 -3
- data/spec/rubocop/cop/style/empty_line_between_defs_spec.rb +4 -4
- data/spec/rubocop/cop/style/empty_lines_around_body_spec.rb +13 -0
- 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 +1 -1
- data/spec/rubocop/cop/style/hash_syntax_spec.rb +5 -0
- data/spec/rubocop/cop/style/{favor_modifier_spec.rb → if_unless_modifier_spec.rb} +4 -111
- data/spec/rubocop/cop/style/indentation_consistency_spec.rb +490 -0
- data/spec/rubocop/cop/style/indentation_width_spec.rb +19 -91
- data/spec/rubocop/cop/style/lambda_call_spec.rb +18 -0
- data/spec/rubocop/cop/style/method_called_on_do_end_block_spec.rb +2 -2
- data/spec/rubocop/cop/style/method_def_parentheses_spec.rb +35 -1
- data/spec/rubocop/cop/style/method_length_spec.rb +1 -0
- data/spec/rubocop/cop/style/method_name_spec.rb +27 -5
- data/spec/rubocop/cop/style/multiline_block_chain_spec.rb +4 -4
- data/spec/rubocop/cop/style/multiline_if_then_spec.rb +2 -2
- data/spec/rubocop/cop/style/multiline_ternary_operator_spec.rb +18 -0
- data/spec/rubocop/cop/style/{ternary_operator_spec.rb → nested_ternary_operator_spec.rb} +0 -15
- data/spec/rubocop/cop/style/numeric_literals_spec.rb +18 -1
- data/spec/rubocop/cop/style/one_line_conditional_spec.rb +2 -1
- data/spec/rubocop/cop/style/parameter_lists_spec.rb +1 -0
- data/spec/rubocop/cop/style/parentheses_around_condition_spec.rb +13 -4
- data/spec/rubocop/cop/style/raise_args_spec.rb +22 -0
- data/spec/rubocop/cop/style/redundant_self_spec.rb +4 -4
- data/spec/rubocop/cop/style/regexp_literal_spec.rb +4 -0
- data/spec/rubocop/cop/style/space_after_colon_spec.rb +12 -4
- data/spec/rubocop/cop/style/space_after_method_name_spec.rb +2 -2
- data/spec/rubocop/cop/style/space_around_block_braces_spec.rb +30 -1
- data/spec/rubocop/cop/style/{space_around_equals_in_default_parameter_spec.rb → space_around_equals_in_parameter_default_spec.rb} +0 -0
- data/spec/rubocop/cop/style/space_around_operators_spec.rb +2 -1
- data/spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb +20 -3
- data/spec/rubocop/cop/style/string_literals_spec.rb +33 -0
- data/spec/rubocop/cop/style/trailing_comma_spec.rb +200 -0
- data/spec/rubocop/cop/style/variable_name_spec.rb +27 -3
- data/spec/rubocop/cop/style/while_until_modifier_spec.rb +75 -0
- data/spec/rubocop/cop/style/word_array_spec.rb +1 -0
- data/spec/rubocop/cop/team_spec.rb +1 -1
- data/spec/rubocop/cop/variable_inspector/scope_spec.rb +3 -4
- data/spec/rubocop/file_inspector_spec.rb +1 -1
- data/spec/rubocop/formatter/base_formatter_spec.rb +12 -11
- data/spec/rubocop/formatter/colorizable_spec.rb +107 -0
- data/spec/rubocop/formatter/disabled_config_formatter_spec.rb +2 -0
- data/spec/rubocop/formatter/formatter_set_spec.rb +1 -1
- data/spec/rubocop/formatter/json_formatter_spec.rb +4 -3
- data/spec/rubocop/formatter/progress_formatter_spec.rb +2 -2
- data/spec/rubocop/options_spec.rb +3 -1
- data/spec/rubocop/target_finder_spec.rb +13 -11
- data/spec/spec_helper.rb +5 -1
- data/spec/support/shared_examples.rb +2 -2
- data/spec/support/statement_modifier_helper.rb +41 -0
- metadata +88 -30
- data/lib/rubocop/cop/check_assignment.rb +0 -43
- data/lib/rubocop/cop/style/array_syntax.rb +0 -22
- data/lib/rubocop/cop/style/autocorrect_alignment.rb +0 -78
- data/lib/rubocop/cop/style/code_length.rb +0 -35
- data/lib/rubocop/cop/style/configurable_enforced_style.rb +0 -51
- data/lib/rubocop/cop/style/configurable_max.rb +0 -17
- data/lib/rubocop/cop/style/configurable_naming.rb +0 -41
- data/lib/rubocop/cop/style/favor_modifier.rb +0 -118
- data/lib/rubocop/cop/style/if_then_else.rb +0 -27
- data/lib/rubocop/cop/style/space_after_comma_etc.rb +0 -73
- data/lib/rubocop/cop/style/space_inside.rb +0 -33
- data/lib/rubocop/cop/style/string_help.rb +0 -30
- data/lib/rubocop/cop/style/surrounding_space.rb +0 -44
@@ -0,0 +1,107 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'rubocop/formatter/colorizable'
|
5
|
+
require 'stringio'
|
6
|
+
|
7
|
+
module Rubocop
|
8
|
+
module Formatter
|
9
|
+
describe Colorizable do
|
10
|
+
let(:formatter_class) do
|
11
|
+
Class.new(BaseFormatter) do
|
12
|
+
include Colorizable
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:formatter) do
|
17
|
+
formatter_class.new(output)
|
18
|
+
end
|
19
|
+
|
20
|
+
let(:output) { double('output') }
|
21
|
+
|
22
|
+
around do |example|
|
23
|
+
original_state = Rainbow.enabled
|
24
|
+
|
25
|
+
begin
|
26
|
+
example.run
|
27
|
+
ensure
|
28
|
+
Rainbow.enabled = original_state
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe '#colorize' do
|
33
|
+
subject { formatter.colorize('foo', :red) }
|
34
|
+
|
35
|
+
shared_examples 'does nothing' do
|
36
|
+
it 'does nothing' do
|
37
|
+
should == 'foo'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'when the global Rainbow.enabled is true' do
|
42
|
+
before do
|
43
|
+
Rainbow.enabled = true
|
44
|
+
end
|
45
|
+
|
46
|
+
context "and the formatter's output is a tty" do
|
47
|
+
before do
|
48
|
+
allow(output).to receive(:tty?).and_return(true)
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'colorize the passed string' do
|
52
|
+
should == "\e[31mfoo\e[0m"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
context "and the formatter's output is not a tty" do
|
57
|
+
before do
|
58
|
+
allow(output).to receive(:tty?).and_return(false)
|
59
|
+
end
|
60
|
+
|
61
|
+
include_examples 'does nothing'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context 'when the global Rainbow.enabled is false' do
|
66
|
+
before do
|
67
|
+
Rainbow.enabled = false
|
68
|
+
end
|
69
|
+
|
70
|
+
context "and the formatter's output is a tty" do
|
71
|
+
before do
|
72
|
+
allow(output).to receive(:tty?).and_return(true)
|
73
|
+
end
|
74
|
+
|
75
|
+
include_examples 'does nothing'
|
76
|
+
end
|
77
|
+
|
78
|
+
context "and the formatter's output is not a tty" do
|
79
|
+
before do
|
80
|
+
allow(output).to receive(:tty?).and_return(false)
|
81
|
+
end
|
82
|
+
|
83
|
+
include_examples 'does nothing'
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
[
|
89
|
+
:black,
|
90
|
+
:red,
|
91
|
+
:green,
|
92
|
+
:yellow,
|
93
|
+
:blue,
|
94
|
+
:magenta,
|
95
|
+
:cyan,
|
96
|
+
:white
|
97
|
+
].each do |color|
|
98
|
+
describe "##{color}" do
|
99
|
+
it "invokes #colorize(string, #{color}" do
|
100
|
+
expect(formatter).to receive(:colorize).with('foo', color)
|
101
|
+
formatter.send(color, 'foo')
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -24,7 +24,7 @@ module Rubocop
|
|
24
24
|
|
25
25
|
it 'invokes same method of all containing formatters' do
|
26
26
|
formatter_set.each do |formatter|
|
27
|
-
formatter.
|
27
|
+
expect(formatter).to receive(:started).with(files)
|
28
28
|
end
|
29
29
|
formatter_set.started(files)
|
30
30
|
end
|
@@ -31,7 +31,7 @@ module Rubocop
|
|
31
31
|
describe '#file_finished' do
|
32
32
|
before do
|
33
33
|
count = 0
|
34
|
-
formatter.
|
34
|
+
allow(formatter).to receive(:hash_for_file) do
|
35
35
|
count += 1
|
36
36
|
end
|
37
37
|
end
|
@@ -92,7 +92,7 @@ module Rubocop
|
|
92
92
|
|
93
93
|
before do
|
94
94
|
count = 0
|
95
|
-
formatter.
|
95
|
+
allow(formatter).to receive(:hash_for_offence) do
|
96
96
|
count += 1
|
97
97
|
end
|
98
98
|
end
|
@@ -122,7 +122,8 @@ module Rubocop
|
|
122
122
|
end
|
123
123
|
|
124
124
|
before do
|
125
|
-
formatter
|
125
|
+
allow(formatter)
|
126
|
+
.to receive(:hash_for_location).and_return(location_hash)
|
126
127
|
end
|
127
128
|
|
128
129
|
let(:location_hash) { { line: 1, column: 2 } }
|
@@ -22,7 +22,7 @@ module Rubocop
|
|
22
22
|
|
23
23
|
shared_examples 'calls #report_file_as_mark' do
|
24
24
|
it 'calls #report_as_with_mark' do
|
25
|
-
formatter.
|
25
|
+
expect(formatter).to receive(:report_file_as_mark)
|
26
26
|
formatter.file_finished(files.first, offences)
|
27
27
|
end
|
28
28
|
end
|
@@ -174,7 +174,7 @@ module Rubocop
|
|
174
174
|
end
|
175
175
|
|
176
176
|
it 'calls #report_summary' do
|
177
|
-
formatter.
|
177
|
+
expect(formatter).to receive(:report_summary)
|
178
178
|
formatter.finished(files)
|
179
179
|
end
|
180
180
|
end
|
@@ -56,9 +56,11 @@ Usage: rubocop [options] [file1, file2, ...]
|
|
56
56
|
specified --format, or the default format
|
57
57
|
if no format is specified.
|
58
58
|
-r, --require FILE Require Ruby file.
|
59
|
-
--show-cops
|
59
|
+
--show-cops [cop1,cop2,...] Shows the given cops, or all cops by
|
60
|
+
default, and their configurations for the
|
60
61
|
current directory.
|
61
62
|
-d, --debug Display debug info.
|
63
|
+
-D, --display-cop-names Display cop names in offence messages.
|
62
64
|
-R, --rails Run extra Rails cops.
|
63
65
|
-l, --lint Run only lint cops.
|
64
66
|
-a, --auto-correct Auto-correct offences.
|
@@ -113,31 +113,31 @@ describe Rubocop::TargetFinder, :isolated_environment do
|
|
113
113
|
|
114
114
|
it 'picks files specified to be included in config' do
|
115
115
|
config = double('config')
|
116
|
-
config.
|
116
|
+
allow(config).to receive(:file_to_include?) do |file|
|
117
117
|
File.basename(file) == 'file'
|
118
118
|
end
|
119
|
-
config.
|
120
|
-
config_store.
|
119
|
+
allow(config).to receive(:file_to_exclude?).and_return(false)
|
120
|
+
allow(config_store).to receive(:for).and_return(config)
|
121
121
|
|
122
122
|
expect(found_basenames).to include('file')
|
123
123
|
end
|
124
124
|
|
125
125
|
it 'does not pick files specified to be excluded in config' do
|
126
126
|
config = double('config').as_null_object
|
127
|
-
config.
|
128
|
-
config.
|
127
|
+
allow(config).to receive(:file_to_include?).and_return(false)
|
128
|
+
allow(config).to receive(:file_to_exclude?) do |file|
|
129
129
|
File.basename(file) == 'ruby2.rb'
|
130
130
|
end
|
131
|
-
config_store.
|
131
|
+
allow(config_store).to receive(:for).and_return(config)
|
132
132
|
|
133
133
|
expect(found_basenames).not_to include('ruby2.rb')
|
134
134
|
end
|
135
135
|
|
136
136
|
it 'does not return duplicated paths' do
|
137
137
|
config = double('config').as_null_object
|
138
|
-
config.
|
139
|
-
config.
|
140
|
-
config_store.
|
138
|
+
allow(config).to receive(:file_to_include?).and_return(true)
|
139
|
+
allow(config).to receive(:file_to_exclude?).and_return(false)
|
140
|
+
allow(config_store).to receive(:for).and_return(config)
|
141
141
|
|
142
142
|
count = found_basenames.count { |f| f == 'ruby1.rb' }
|
143
143
|
expect(count).to eq(1)
|
@@ -145,8 +145,6 @@ describe Rubocop::TargetFinder, :isolated_environment do
|
|
145
145
|
|
146
146
|
context 'when an exception is raised while reading file' do
|
147
147
|
around do |example|
|
148
|
-
File.any_instance.stub(:readline).and_raise(EOFError)
|
149
|
-
|
150
148
|
original_stderr = $stderr
|
151
149
|
$stderr = StringIO.new
|
152
150
|
begin
|
@@ -156,6 +154,10 @@ describe Rubocop::TargetFinder, :isolated_environment do
|
|
156
154
|
end
|
157
155
|
end
|
158
156
|
|
157
|
+
before do
|
158
|
+
allow_any_instance_of(File).to receive(:readline).and_raise(EOFError)
|
159
|
+
end
|
160
|
+
|
159
161
|
context 'and debug mode is enabled' do
|
160
162
|
let(:debug) { true }
|
161
163
|
|
data/spec/spec_helper.rb
CHANGED
@@ -33,7 +33,7 @@ require 'rubocop'
|
|
33
33
|
require 'rubocop/cli'
|
34
34
|
|
35
35
|
# disable colors in specs
|
36
|
-
|
36
|
+
Rainbow.enabled = false
|
37
37
|
|
38
38
|
module ExitCodeMatchers
|
39
39
|
RSpec::Matchers.define :exit_with_code do |code|
|
@@ -71,6 +71,10 @@ RSpec.configure do |config|
|
|
71
71
|
c.syntax = :expect # disables `should`
|
72
72
|
end
|
73
73
|
|
74
|
+
config.mock_with :rspec do |c|
|
75
|
+
c.syntax = :expect # disables `should_receive` and `stub`
|
76
|
+
end
|
77
|
+
|
74
78
|
config.include(ExitCodeMatchers)
|
75
79
|
end
|
76
80
|
|
@@ -9,8 +9,8 @@ shared_examples_for 'accepts' do
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
shared_examples_for 'mimics MRI 2.
|
13
|
-
if RUBY_ENGINE == 'ruby' && RUBY_VERSION.start_with?('2.
|
12
|
+
shared_examples_for 'mimics MRI 2.1' do |grep_mri_warning|
|
13
|
+
if RUBY_ENGINE == 'ruby' && RUBY_VERSION.start_with?('2.1')
|
14
14
|
it "mimics MRI #{RUBY_VERSION} built-in syntax checking" do
|
15
15
|
inspect_source(cop, source)
|
16
16
|
offences_by_mri = MRISyntaxChecker.offences_for_source(
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module StatementModifierHelper
|
4
|
+
def check_empty(cop, keyword)
|
5
|
+
inspect_source(cop, ["#{keyword} cond",
|
6
|
+
'end'])
|
7
|
+
expect(cop.offences).to be_empty
|
8
|
+
end
|
9
|
+
|
10
|
+
def check_really_short(cop, keyword)
|
11
|
+
inspect_source(cop, ["#{keyword} a",
|
12
|
+
' b',
|
13
|
+
'end'])
|
14
|
+
expect(cop.messages).to eq(
|
15
|
+
["Favor modifier #{keyword} usage when you have a single-line body."])
|
16
|
+
expect(cop.offences.map { |o| o.location.source }).to eq([keyword])
|
17
|
+
end
|
18
|
+
|
19
|
+
def check_too_long(cop, keyword)
|
20
|
+
# This statement is one character too long to fit.
|
21
|
+
condition = 'a' * (40 - keyword.length)
|
22
|
+
body = 'b' * 36
|
23
|
+
expect(" #{body} #{keyword} #{condition}".length).to eq(80)
|
24
|
+
|
25
|
+
inspect_source(cop,
|
26
|
+
[" #{keyword} #{condition}",
|
27
|
+
" #{body}",
|
28
|
+
' end'])
|
29
|
+
|
30
|
+
expect(cop.offences).to be_empty
|
31
|
+
end
|
32
|
+
|
33
|
+
def check_short_multiline(cop, keyword)
|
34
|
+
inspect_source(cop,
|
35
|
+
["#{keyword} ENV['COVERAGE']",
|
36
|
+
" require 'simplecov'",
|
37
|
+
' SimpleCov.start',
|
38
|
+
'end'])
|
39
|
+
expect(cop.messages).to be_empty
|
40
|
+
end
|
41
|
+
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.1
|
19
|
+
version: 1.99.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.1
|
26
|
+
version: 1.99.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: parser
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.1.3
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.1.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: powerpack
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.0.6
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: json
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.8'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.8'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,20 +167,24 @@ files:
|
|
153
167
|
- lib/rubocop/config.rb
|
154
168
|
- lib/rubocop/config_loader.rb
|
155
169
|
- lib/rubocop/config_store.rb
|
156
|
-
- lib/rubocop/cop/check_assignment.rb
|
157
|
-
- lib/rubocop/cop/check_methods.rb
|
158
170
|
- lib/rubocop/cop/commissioner.rb
|
159
171
|
- lib/rubocop/cop/cop.rb
|
160
172
|
- lib/rubocop/cop/corrector.rb
|
173
|
+
- lib/rubocop/cop/ignored_node.rb
|
174
|
+
- lib/rubocop/cop/lint/ambiguous_operator.rb
|
175
|
+
- lib/rubocop/cop/lint/ambiguous_regexp_literal.rb
|
161
176
|
- lib/rubocop/cop/lint/assignment_in_condition.rb
|
162
177
|
- lib/rubocop/cop/lint/block_alignment.rb
|
178
|
+
- lib/rubocop/cop/lint/condition_position.rb
|
163
179
|
- lib/rubocop/cop/lint/debugger.rb
|
180
|
+
- lib/rubocop/cop/lint/else_layout.rb
|
164
181
|
- lib/rubocop/cop/lint/empty_ensure.rb
|
165
182
|
- lib/rubocop/cop/lint/end_alignment.rb
|
166
183
|
- lib/rubocop/cop/lint/end_in_method.rb
|
167
184
|
- lib/rubocop/cop/lint/ensure_return.rb
|
168
185
|
- lib/rubocop/cop/lint/eval.rb
|
169
186
|
- lib/rubocop/cop/lint/handle_exceptions.rb
|
187
|
+
- lib/rubocop/cop/lint/invalid_character_literal.rb
|
170
188
|
- lib/rubocop/cop/lint/literal_in_condition.rb
|
171
189
|
- lib/rubocop/cop/lint/loop.rb
|
172
190
|
- lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb
|
@@ -176,8 +194,27 @@ files:
|
|
176
194
|
- lib/rubocop/cop/lint/unreachable_code.rb
|
177
195
|
- lib/rubocop/cop/lint/useless_assignment.rb
|
178
196
|
- lib/rubocop/cop/lint/useless_comparison.rb
|
197
|
+
- lib/rubocop/cop/lint/useless_else_without_rescue.rb
|
179
198
|
- lib/rubocop/cop/lint/useless_setter_call.rb
|
180
199
|
- lib/rubocop/cop/lint/void.rb
|
200
|
+
- lib/rubocop/cop/mixin/array_syntax.rb
|
201
|
+
- lib/rubocop/cop/mixin/autocorrect_alignment.rb
|
202
|
+
- lib/rubocop/cop/mixin/check_assignment.rb
|
203
|
+
- lib/rubocop/cop/mixin/check_methods.rb
|
204
|
+
- lib/rubocop/cop/mixin/code_length.rb
|
205
|
+
- lib/rubocop/cop/mixin/configurable_enforced_style.rb
|
206
|
+
- lib/rubocop/cop/mixin/configurable_max.rb
|
207
|
+
- lib/rubocop/cop/mixin/configurable_naming.rb
|
208
|
+
- lib/rubocop/cop/mixin/if_node.rb
|
209
|
+
- lib/rubocop/cop/mixin/if_then_else.rb
|
210
|
+
- lib/rubocop/cop/mixin/negative_conditional.rb
|
211
|
+
- lib/rubocop/cop/mixin/parser_diagnostic.rb
|
212
|
+
- lib/rubocop/cop/mixin/safe_assignment.rb
|
213
|
+
- lib/rubocop/cop/mixin/space_after_punctuation.rb
|
214
|
+
- lib/rubocop/cop/mixin/space_inside.rb
|
215
|
+
- lib/rubocop/cop/mixin/statement_modifier.rb
|
216
|
+
- lib/rubocop/cop/mixin/string_help.rb
|
217
|
+
- lib/rubocop/cop/mixin/surrounding_space.rb
|
181
218
|
- lib/rubocop/cop/offence.rb
|
182
219
|
- lib/rubocop/cop/rails/default_scope.rb
|
183
220
|
- lib/rubocop/cop/rails/has_and_belongs_to_many.rb
|
@@ -191,11 +228,9 @@ files:
|
|
191
228
|
- lib/rubocop/cop/style/align_hash.rb
|
192
229
|
- lib/rubocop/cop/style/align_parameters.rb
|
193
230
|
- lib/rubocop/cop/style/and_or.rb
|
194
|
-
- lib/rubocop/cop/style/array_syntax.rb
|
195
231
|
- lib/rubocop/cop/style/ascii_comments.rb
|
196
232
|
- lib/rubocop/cop/style/ascii_identifiers.rb
|
197
233
|
- lib/rubocop/cop/style/attr.rb
|
198
|
-
- lib/rubocop/cop/style/autocorrect_alignment.rb
|
199
234
|
- lib/rubocop/cop/style/begin_block.rb
|
200
235
|
- lib/rubocop/cop/style/block_comments.rb
|
201
236
|
- lib/rubocop/cop/style/block_nesting.rb
|
@@ -208,13 +243,9 @@ files:
|
|
208
243
|
- lib/rubocop/cop/style/class_length.rb
|
209
244
|
- lib/rubocop/cop/style/class_methods.rb
|
210
245
|
- lib/rubocop/cop/style/class_vars.rb
|
211
|
-
- lib/rubocop/cop/style/code_length.rb
|
212
246
|
- lib/rubocop/cop/style/collection_methods.rb
|
213
247
|
- lib/rubocop/cop/style/colon_method_call.rb
|
214
248
|
- lib/rubocop/cop/style/comment_annotation.rb
|
215
|
-
- lib/rubocop/cop/style/configurable_enforced_style.rb
|
216
|
-
- lib/rubocop/cop/style/configurable_max.rb
|
217
|
-
- lib/rubocop/cop/style/configurable_naming.rb
|
218
249
|
- lib/rubocop/cop/style/constant_name.rb
|
219
250
|
- lib/rubocop/cop/style/cyclomatic_complexity.rb
|
220
251
|
- lib/rubocop/cop/style/def_parentheses.rb
|
@@ -230,18 +261,18 @@ files:
|
|
230
261
|
- lib/rubocop/cop/style/end_of_line.rb
|
231
262
|
- lib/rubocop/cop/style/even_odd.rb
|
232
263
|
- lib/rubocop/cop/style/favor_join.rb
|
233
|
-
- lib/rubocop/cop/style/favor_modifier.rb
|
234
264
|
- lib/rubocop/cop/style/favor_sprintf.rb
|
235
265
|
- lib/rubocop/cop/style/favor_unless_over_negated_if.rb
|
266
|
+
- lib/rubocop/cop/style/favor_until_over_negated_while.rb
|
236
267
|
- lib/rubocop/cop/style/final_newline.rb
|
237
268
|
- lib/rubocop/cop/style/flip_flop.rb
|
238
269
|
- lib/rubocop/cop/style/for.rb
|
239
270
|
- lib/rubocop/cop/style/global_vars.rb
|
240
271
|
- lib/rubocop/cop/style/hash_methods.rb
|
241
272
|
- lib/rubocop/cop/style/hash_syntax.rb
|
242
|
-
- lib/rubocop/cop/style/
|
243
|
-
- lib/rubocop/cop/style/if_then_else.rb
|
273
|
+
- lib/rubocop/cop/style/if_unless_modifier.rb
|
244
274
|
- lib/rubocop/cop/style/if_with_semicolon.rb
|
275
|
+
- lib/rubocop/cop/style/indentation_consistency.rb
|
245
276
|
- lib/rubocop/cop/style/indentation_width.rb
|
246
277
|
- lib/rubocop/cop/style/lambda.rb
|
247
278
|
- lib/rubocop/cop/style/lambda_call.rb
|
@@ -255,6 +286,8 @@ files:
|
|
255
286
|
- lib/rubocop/cop/style/module_function.rb
|
256
287
|
- lib/rubocop/cop/style/multiline_block_chain.rb
|
257
288
|
- lib/rubocop/cop/style/multiline_if_then.rb
|
289
|
+
- lib/rubocop/cop/style/multiline_ternary_operator.rb
|
290
|
+
- lib/rubocop/cop/style/nested_ternary_operator.rb
|
258
291
|
- lib/rubocop/cop/style/nil_comparison.rb
|
259
292
|
- lib/rubocop/cop/style/not.rb
|
260
293
|
- lib/rubocop/cop/style/numeric_literals.rb
|
@@ -276,26 +309,25 @@ files:
|
|
276
309
|
- lib/rubocop/cop/style/signal_exception.rb
|
277
310
|
- lib/rubocop/cop/style/single_line_block_params.rb
|
278
311
|
- lib/rubocop/cop/style/single_line_methods.rb
|
279
|
-
- lib/rubocop/cop/style/
|
312
|
+
- lib/rubocop/cop/style/space_after_colon.rb
|
313
|
+
- lib/rubocop/cop/style/space_after_comma.rb
|
280
314
|
- lib/rubocop/cop/style/space_after_control_keyword.rb
|
281
315
|
- lib/rubocop/cop/style/space_after_method_name.rb
|
282
316
|
- lib/rubocop/cop/style/space_after_not.rb
|
317
|
+
- lib/rubocop/cop/style/space_after_semicolon.rb
|
283
318
|
- lib/rubocop/cop/style/space_around_block_braces.rb
|
284
319
|
- lib/rubocop/cop/style/space_around_equals_in_parameter_default.rb
|
285
320
|
- lib/rubocop/cop/style/space_around_operators.rb
|
286
321
|
- lib/rubocop/cop/style/space_before_modifier_keyword.rb
|
287
|
-
- lib/rubocop/cop/style/space_inside.rb
|
288
322
|
- lib/rubocop/cop/style/space_inside_brackets.rb
|
289
323
|
- lib/rubocop/cop/style/space_inside_hash_literal_braces.rb
|
290
324
|
- lib/rubocop/cop/style/space_inside_parens.rb
|
291
325
|
- lib/rubocop/cop/style/special_global_vars.rb
|
292
|
-
- lib/rubocop/cop/style/string_help.rb
|
293
326
|
- lib/rubocop/cop/style/string_literals.rb
|
294
|
-
- lib/rubocop/cop/style/surrounding_space.rb
|
295
327
|
- lib/rubocop/cop/style/symbol_array.rb
|
296
328
|
- lib/rubocop/cop/style/tab.rb
|
297
|
-
- lib/rubocop/cop/style/ternary_operator.rb
|
298
329
|
- lib/rubocop/cop/style/trailing_blank_lines.rb
|
330
|
+
- lib/rubocop/cop/style/trailing_comma.rb
|
299
331
|
- lib/rubocop/cop/style/trailing_whitespace.rb
|
300
332
|
- lib/rubocop/cop/style/trivial_accessors.rb
|
301
333
|
- lib/rubocop/cop/style/unless_else.rb
|
@@ -303,6 +335,7 @@ files:
|
|
303
335
|
- lib/rubocop/cop/style/variable_name.rb
|
304
336
|
- lib/rubocop/cop/style/when_then.rb
|
305
337
|
- lib/rubocop/cop/style/while_until_do.rb
|
338
|
+
- lib/rubocop/cop/style/while_until_modifier.rb
|
306
339
|
- lib/rubocop/cop/style/word_array.rb
|
307
340
|
- lib/rubocop/cop/team.rb
|
308
341
|
- lib/rubocop/cop/util.rb
|
@@ -316,6 +349,7 @@ files:
|
|
316
349
|
- lib/rubocop/file_inspector.rb
|
317
350
|
- lib/rubocop/formatter/base_formatter.rb
|
318
351
|
- lib/rubocop/formatter/clang_style_formatter.rb
|
352
|
+
- lib/rubocop/formatter/colorizable.rb
|
319
353
|
- lib/rubocop/formatter/disabled_config_formatter.rb
|
320
354
|
- lib/rubocop/formatter/emacs_style_formatter.rb
|
321
355
|
- lib/rubocop/formatter/file_list_formatter.rb
|
@@ -343,15 +377,20 @@ files:
|
|
343
377
|
- spec/rubocop/cop/commissioner_spec.rb
|
344
378
|
- spec/rubocop/cop/cop_spec.rb
|
345
379
|
- spec/rubocop/cop/corrector_spec.rb
|
380
|
+
- spec/rubocop/cop/lint/ambiguous_operator_spec.rb
|
381
|
+
- spec/rubocop/cop/lint/ambiguous_regexp_literal_spec.rb
|
346
382
|
- spec/rubocop/cop/lint/assignment_in_condition_spec.rb
|
347
383
|
- spec/rubocop/cop/lint/block_alignment_spec.rb
|
384
|
+
- spec/rubocop/cop/lint/condition_position_spec.rb
|
348
385
|
- spec/rubocop/cop/lint/debugger_spec.rb
|
386
|
+
- spec/rubocop/cop/lint/else_layout_spec.rb
|
349
387
|
- spec/rubocop/cop/lint/empty_ensure_spec.rb
|
350
388
|
- spec/rubocop/cop/lint/end_alignment_spec.rb
|
351
389
|
- spec/rubocop/cop/lint/end_in_method_spec.rb
|
352
390
|
- spec/rubocop/cop/lint/ensure_return_spec.rb
|
353
391
|
- spec/rubocop/cop/lint/eval_spec.rb
|
354
392
|
- spec/rubocop/cop/lint/handle_exceptions_spec.rb
|
393
|
+
- spec/rubocop/cop/lint/invalid_character_literal_spec.rb
|
355
394
|
- spec/rubocop/cop/lint/literal_in_condition_spec.rb
|
356
395
|
- spec/rubocop/cop/lint/loop_spec.rb
|
357
396
|
- spec/rubocop/cop/lint/parentheses_as_grouped_expression_spec.rb
|
@@ -361,6 +400,7 @@ files:
|
|
361
400
|
- spec/rubocop/cop/lint/unreachable_code_spec.rb
|
362
401
|
- spec/rubocop/cop/lint/useless_assignment_spec.rb
|
363
402
|
- spec/rubocop/cop/lint/useless_comparison_spec.rb
|
403
|
+
- spec/rubocop/cop/lint/useless_else_without_rescue_spec.rb
|
364
404
|
- spec/rubocop/cop/lint/useless_setter_call_spec.rb
|
365
405
|
- spec/rubocop/cop/lint/void_spec.rb
|
366
406
|
- spec/rubocop/cop/offence_spec.rb
|
@@ -409,7 +449,6 @@ files:
|
|
409
449
|
- spec/rubocop/cop/style/end_of_line_spec.rb
|
410
450
|
- spec/rubocop/cop/style/even_odd_spec.rb
|
411
451
|
- spec/rubocop/cop/style/favor_join_spec.rb
|
412
|
-
- spec/rubocop/cop/style/favor_modifier_spec.rb
|
413
452
|
- spec/rubocop/cop/style/favor_sprintf_spec.rb
|
414
453
|
- spec/rubocop/cop/style/favor_unless_over_negated_if_spec.rb
|
415
454
|
- spec/rubocop/cop/style/favor_until_over_negated_while_spec.rb
|
@@ -419,7 +458,9 @@ files:
|
|
419
458
|
- spec/rubocop/cop/style/global_vars_spec.rb
|
420
459
|
- spec/rubocop/cop/style/hash_methods_spec.rb
|
421
460
|
- spec/rubocop/cop/style/hash_syntax_spec.rb
|
461
|
+
- spec/rubocop/cop/style/if_unless_modifier_spec.rb
|
422
462
|
- spec/rubocop/cop/style/if_with_semicolon_spec.rb
|
463
|
+
- spec/rubocop/cop/style/indentation_consistency_spec.rb
|
423
464
|
- spec/rubocop/cop/style/indentation_width_spec.rb
|
424
465
|
- spec/rubocop/cop/style/lambda_call_spec.rb
|
425
466
|
- spec/rubocop/cop/style/lambda_spec.rb
|
@@ -433,6 +474,8 @@ files:
|
|
433
474
|
- spec/rubocop/cop/style/module_function_spec.rb
|
434
475
|
- spec/rubocop/cop/style/multiline_block_chain_spec.rb
|
435
476
|
- spec/rubocop/cop/style/multiline_if_then_spec.rb
|
477
|
+
- spec/rubocop/cop/style/multiline_ternary_operator_spec.rb
|
478
|
+
- spec/rubocop/cop/style/nested_ternary_operator_spec.rb
|
436
479
|
- spec/rubocop/cop/style/nil_comparison_spec.rb
|
437
480
|
- spec/rubocop/cop/style/not_spec.rb
|
438
481
|
- spec/rubocop/cop/style/numeric_literals_spec.rb
|
@@ -461,7 +504,7 @@ files:
|
|
461
504
|
- spec/rubocop/cop/style/space_after_not_spec.rb
|
462
505
|
- spec/rubocop/cop/style/space_after_semicolon_spec.rb
|
463
506
|
- spec/rubocop/cop/style/space_around_block_braces_spec.rb
|
464
|
-
- spec/rubocop/cop/style/
|
507
|
+
- spec/rubocop/cop/style/space_around_equals_in_parameter_default_spec.rb
|
465
508
|
- spec/rubocop/cop/style/space_around_operators_spec.rb
|
466
509
|
- spec/rubocop/cop/style/space_before_modifier_keyword_spec.rb
|
467
510
|
- spec/rubocop/cop/style/space_inside_brackets_spec.rb
|
@@ -471,8 +514,8 @@ files:
|
|
471
514
|
- spec/rubocop/cop/style/string_literals_spec.rb
|
472
515
|
- spec/rubocop/cop/style/symbol_array_spec.rb
|
473
516
|
- spec/rubocop/cop/style/tab_spec.rb
|
474
|
-
- spec/rubocop/cop/style/ternary_operator_spec.rb
|
475
517
|
- spec/rubocop/cop/style/trailing_blank_lines_spec.rb
|
518
|
+
- spec/rubocop/cop/style/trailing_comma_spec.rb
|
476
519
|
- spec/rubocop/cop/style/trailing_whitespace_spec.rb
|
477
520
|
- spec/rubocop/cop/style/trivial_accessors_spec.rb
|
478
521
|
- spec/rubocop/cop/style/unless_else_spec.rb
|
@@ -480,6 +523,7 @@ files:
|
|
480
523
|
- spec/rubocop/cop/style/variable_name_spec.rb
|
481
524
|
- spec/rubocop/cop/style/when_then_spec.rb
|
482
525
|
- spec/rubocop/cop/style/while_until_do_spec.rb
|
526
|
+
- spec/rubocop/cop/style/while_until_modifier_spec.rb
|
483
527
|
- spec/rubocop/cop/style/word_array_spec.rb
|
484
528
|
- spec/rubocop/cop/team_spec.rb
|
485
529
|
- spec/rubocop/cop/util_spec.rb
|
@@ -492,6 +536,7 @@ files:
|
|
492
536
|
- spec/rubocop/file_inspector_spec.rb
|
493
537
|
- spec/rubocop/formatter/base_formatter_spec.rb
|
494
538
|
- spec/rubocop/formatter/clang_style_formatter_spec.rb
|
539
|
+
- spec/rubocop/formatter/colorizable_spec.rb
|
495
540
|
- spec/rubocop/formatter/disabled_config_formatter_spec.rb
|
496
541
|
- spec/rubocop/formatter/emacs_style_formatter_spec.rb
|
497
542
|
- spec/rubocop/formatter/file_list_formatter_spec.rb
|
@@ -512,6 +557,7 @@ files:
|
|
512
557
|
- spec/support/mri_syntax_checker.rb
|
513
558
|
- spec/support/shared_context.rb
|
514
559
|
- spec/support/shared_examples.rb
|
560
|
+
- spec/support/statement_modifier_helper.rb
|
515
561
|
homepage: http://github.com/bbatsov/rubocop
|
516
562
|
licenses:
|
517
563
|
- MIT
|
@@ -547,15 +593,20 @@ test_files:
|
|
547
593
|
- spec/rubocop/cop/commissioner_spec.rb
|
548
594
|
- spec/rubocop/cop/cop_spec.rb
|
549
595
|
- spec/rubocop/cop/corrector_spec.rb
|
596
|
+
- spec/rubocop/cop/lint/ambiguous_operator_spec.rb
|
597
|
+
- spec/rubocop/cop/lint/ambiguous_regexp_literal_spec.rb
|
550
598
|
- spec/rubocop/cop/lint/assignment_in_condition_spec.rb
|
551
599
|
- spec/rubocop/cop/lint/block_alignment_spec.rb
|
600
|
+
- spec/rubocop/cop/lint/condition_position_spec.rb
|
552
601
|
- spec/rubocop/cop/lint/debugger_spec.rb
|
602
|
+
- spec/rubocop/cop/lint/else_layout_spec.rb
|
553
603
|
- spec/rubocop/cop/lint/empty_ensure_spec.rb
|
554
604
|
- spec/rubocop/cop/lint/end_alignment_spec.rb
|
555
605
|
- spec/rubocop/cop/lint/end_in_method_spec.rb
|
556
606
|
- spec/rubocop/cop/lint/ensure_return_spec.rb
|
557
607
|
- spec/rubocop/cop/lint/eval_spec.rb
|
558
608
|
- spec/rubocop/cop/lint/handle_exceptions_spec.rb
|
609
|
+
- spec/rubocop/cop/lint/invalid_character_literal_spec.rb
|
559
610
|
- spec/rubocop/cop/lint/literal_in_condition_spec.rb
|
560
611
|
- spec/rubocop/cop/lint/loop_spec.rb
|
561
612
|
- spec/rubocop/cop/lint/parentheses_as_grouped_expression_spec.rb
|
@@ -565,6 +616,7 @@ test_files:
|
|
565
616
|
- spec/rubocop/cop/lint/unreachable_code_spec.rb
|
566
617
|
- spec/rubocop/cop/lint/useless_assignment_spec.rb
|
567
618
|
- spec/rubocop/cop/lint/useless_comparison_spec.rb
|
619
|
+
- spec/rubocop/cop/lint/useless_else_without_rescue_spec.rb
|
568
620
|
- spec/rubocop/cop/lint/useless_setter_call_spec.rb
|
569
621
|
- spec/rubocop/cop/lint/void_spec.rb
|
570
622
|
- spec/rubocop/cop/offence_spec.rb
|
@@ -613,7 +665,6 @@ test_files:
|
|
613
665
|
- spec/rubocop/cop/style/end_of_line_spec.rb
|
614
666
|
- spec/rubocop/cop/style/even_odd_spec.rb
|
615
667
|
- spec/rubocop/cop/style/favor_join_spec.rb
|
616
|
-
- spec/rubocop/cop/style/favor_modifier_spec.rb
|
617
668
|
- spec/rubocop/cop/style/favor_sprintf_spec.rb
|
618
669
|
- spec/rubocop/cop/style/favor_unless_over_negated_if_spec.rb
|
619
670
|
- spec/rubocop/cop/style/favor_until_over_negated_while_spec.rb
|
@@ -623,7 +674,9 @@ test_files:
|
|
623
674
|
- spec/rubocop/cop/style/global_vars_spec.rb
|
624
675
|
- spec/rubocop/cop/style/hash_methods_spec.rb
|
625
676
|
- spec/rubocop/cop/style/hash_syntax_spec.rb
|
677
|
+
- spec/rubocop/cop/style/if_unless_modifier_spec.rb
|
626
678
|
- spec/rubocop/cop/style/if_with_semicolon_spec.rb
|
679
|
+
- spec/rubocop/cop/style/indentation_consistency_spec.rb
|
627
680
|
- spec/rubocop/cop/style/indentation_width_spec.rb
|
628
681
|
- spec/rubocop/cop/style/lambda_call_spec.rb
|
629
682
|
- spec/rubocop/cop/style/lambda_spec.rb
|
@@ -637,6 +690,8 @@ test_files:
|
|
637
690
|
- spec/rubocop/cop/style/module_function_spec.rb
|
638
691
|
- spec/rubocop/cop/style/multiline_block_chain_spec.rb
|
639
692
|
- spec/rubocop/cop/style/multiline_if_then_spec.rb
|
693
|
+
- spec/rubocop/cop/style/multiline_ternary_operator_spec.rb
|
694
|
+
- spec/rubocop/cop/style/nested_ternary_operator_spec.rb
|
640
695
|
- spec/rubocop/cop/style/nil_comparison_spec.rb
|
641
696
|
- spec/rubocop/cop/style/not_spec.rb
|
642
697
|
- spec/rubocop/cop/style/numeric_literals_spec.rb
|
@@ -665,7 +720,7 @@ test_files:
|
|
665
720
|
- spec/rubocop/cop/style/space_after_not_spec.rb
|
666
721
|
- spec/rubocop/cop/style/space_after_semicolon_spec.rb
|
667
722
|
- spec/rubocop/cop/style/space_around_block_braces_spec.rb
|
668
|
-
- spec/rubocop/cop/style/
|
723
|
+
- spec/rubocop/cop/style/space_around_equals_in_parameter_default_spec.rb
|
669
724
|
- spec/rubocop/cop/style/space_around_operators_spec.rb
|
670
725
|
- spec/rubocop/cop/style/space_before_modifier_keyword_spec.rb
|
671
726
|
- spec/rubocop/cop/style/space_inside_brackets_spec.rb
|
@@ -675,8 +730,8 @@ test_files:
|
|
675
730
|
- spec/rubocop/cop/style/string_literals_spec.rb
|
676
731
|
- spec/rubocop/cop/style/symbol_array_spec.rb
|
677
732
|
- spec/rubocop/cop/style/tab_spec.rb
|
678
|
-
- spec/rubocop/cop/style/ternary_operator_spec.rb
|
679
733
|
- spec/rubocop/cop/style/trailing_blank_lines_spec.rb
|
734
|
+
- spec/rubocop/cop/style/trailing_comma_spec.rb
|
680
735
|
- spec/rubocop/cop/style/trailing_whitespace_spec.rb
|
681
736
|
- spec/rubocop/cop/style/trivial_accessors_spec.rb
|
682
737
|
- spec/rubocop/cop/style/unless_else_spec.rb
|
@@ -684,6 +739,7 @@ test_files:
|
|
684
739
|
- spec/rubocop/cop/style/variable_name_spec.rb
|
685
740
|
- spec/rubocop/cop/style/when_then_spec.rb
|
686
741
|
- spec/rubocop/cop/style/while_until_do_spec.rb
|
742
|
+
- spec/rubocop/cop/style/while_until_modifier_spec.rb
|
687
743
|
- spec/rubocop/cop/style/word_array_spec.rb
|
688
744
|
- spec/rubocop/cop/team_spec.rb
|
689
745
|
- spec/rubocop/cop/util_spec.rb
|
@@ -696,6 +752,7 @@ test_files:
|
|
696
752
|
- spec/rubocop/file_inspector_spec.rb
|
697
753
|
- spec/rubocop/formatter/base_formatter_spec.rb
|
698
754
|
- spec/rubocop/formatter/clang_style_formatter_spec.rb
|
755
|
+
- spec/rubocop/formatter/colorizable_spec.rb
|
699
756
|
- spec/rubocop/formatter/disabled_config_formatter_spec.rb
|
700
757
|
- spec/rubocop/formatter/emacs_style_formatter_spec.rb
|
701
758
|
- spec/rubocop/formatter/file_list_formatter_spec.rb
|
@@ -716,4 +773,5 @@ test_files:
|
|
716
773
|
- spec/support/mri_syntax_checker.rb
|
717
774
|
- spec/support/shared_context.rb
|
718
775
|
- spec/support/shared_examples.rb
|
776
|
+
- spec/support/statement_modifier_helper.rb
|
719
777
|
has_rdoc:
|