rubocop 0.25.0 → 0.26.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +37 -0
- data/README.md +2 -2
- data/assets/output.html.erb +190 -0
- data/config/default.yml +14 -2
- data/config/disabled.yml +7 -0
- data/config/enabled.yml +132 -5
- data/lib/rubocop.rb +5 -0
- data/lib/rubocop/cop/commissioner.rb +4 -10
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +1 -1
- data/lib/rubocop/cop/lint/end_in_method.rb +3 -8
- data/lib/rubocop/cop/lint/ensure_return.rb +2 -2
- data/lib/rubocop/cop/lint/space_before_first_arg.rb +8 -1
- data/lib/rubocop/cop/lint/useless_assignment.rb +35 -0
- data/lib/rubocop/cop/lint/useless_setter_call.rb +2 -3
- data/lib/rubocop/cop/metrics/block_nesting.rb +3 -3
- data/lib/rubocop/cop/metrics/class_length.rb +1 -2
- data/lib/rubocop/cop/mixin/access_modifier_node.rb +5 -1
- data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +2 -2
- data/lib/rubocop/cop/mixin/configurable_naming.rb +2 -2
- data/lib/rubocop/cop/mixin/method_complexity.rb +2 -4
- data/lib/rubocop/cop/mixin/statement_modifier.rb +1 -3
- data/lib/rubocop/cop/rails/delegate.rb +1 -1
- data/lib/rubocop/cop/rails/validation.rb +25 -2
- data/lib/rubocop/cop/style/alias.rb +1 -1
- data/lib/rubocop/cop/style/and_or.rb +12 -2
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +19 -12
- data/lib/rubocop/cop/style/documentation.rb +1 -1
- data/lib/rubocop/cop/style/dot_position.rb +20 -0
- data/lib/rubocop/cop/style/empty_lines_around_access_modifier.rb +5 -1
- data/lib/rubocop/cop/style/encoding.rb +4 -4
- data/lib/rubocop/cop/style/format_string.rb +12 -2
- data/lib/rubocop/cop/style/if_unless_modifier.rb +8 -11
- data/lib/rubocop/cop/style/infinite_loop.rb +57 -0
- data/lib/rubocop/cop/style/multiline_block_chain.rb +15 -16
- data/lib/rubocop/cop/style/multiline_if_then.rb +10 -0
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +3 -3
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +3 -1
- data/lib/rubocop/cop/style/predicate_name.rb +23 -5
- data/lib/rubocop/cop/style/redundant_begin.rb +1 -1
- data/lib/rubocop/cop/style/single_line_block_params.rb +1 -1
- data/lib/rubocop/cop/style/space_around_equals_in_parameter_default.rb +4 -8
- data/lib/rubocop/cop/style/space_inside_hash_literal_braces.rb +9 -11
- data/lib/rubocop/cop/style/space_inside_range_literal.rb +58 -0
- data/lib/rubocop/cop/style/special_global_vars.rb +1 -1
- data/lib/rubocop/cop/style/symbol_proc.rb +71 -0
- data/lib/rubocop/cop/style/tab.rb +11 -3
- data/lib/rubocop/cop/style/unneeded_capital_w.rb +6 -2
- data/lib/rubocop/cop/style/variable_name.rb +4 -14
- data/lib/rubocop/cop/style/while_until_modifier.rb +12 -8
- data/lib/rubocop/cop/variable_force.rb +17 -30
- data/lib/rubocop/cop/variable_force/assignment.rb +15 -23
- data/lib/rubocop/cop/variable_force/locatable.rb +29 -8
- data/lib/rubocop/cop/variable_force/scope.rb +34 -23
- data/lib/rubocop/cop/variable_force/variable.rb +7 -10
- data/lib/rubocop/formatter/disabled_config_formatter.rb +3 -2
- data/lib/rubocop/formatter/formatter_set.rb +1 -0
- data/lib/rubocop/formatter/fuubar_style_formatter.rb +1 -1
- data/lib/rubocop/formatter/html_formatter.rb +90 -0
- data/lib/rubocop/formatter/progress_formatter.rb +1 -1
- data/lib/rubocop/options.rb +1 -0
- data/lib/rubocop/processed_source.rb +10 -1
- data/lib/rubocop/string_util.rb +153 -0
- data/lib/rubocop/target_finder.rb +1 -1
- data/lib/rubocop/version.rb +1 -1
- data/relnotes/v0.26.0.md +89 -0
- data/rubocop.gemspec +1 -0
- data/spec/rubocop/cli_spec.rb +60 -34
- data/spec/rubocop/config_loader_spec.rb +19 -15
- data/spec/rubocop/cop/commissioner_spec.rb +2 -2
- data/spec/rubocop/cop/lint/block_alignment_spec.rb +74 -58
- data/spec/rubocop/cop/lint/space_before_first_arg_spec.rb +7 -0
- data/spec/rubocop/cop/lint/useless_assignment_spec.rb +173 -0
- data/spec/rubocop/cop/rails/validation_spec.rb +9 -2
- data/spec/rubocop/cop/style/access_modifier_indentation_spec.rb +26 -0
- data/spec/rubocop/cop/style/and_or_spec.rb +52 -61
- data/spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb +26 -8
- data/spec/rubocop/cop/style/case_indentation_spec.rb +8 -8
- data/spec/rubocop/cop/style/def_with_parentheses_spec.rb +6 -2
- data/spec/rubocop/cop/style/dot_position_spec.rb +39 -0
- data/spec/rubocop/cop/style/empty_lines_around_access_modifier_spec.rb +12 -2
- data/spec/rubocop/cop/style/encoding_spec.rb +16 -28
- data/spec/rubocop/cop/style/format_string_spec.rb +12 -0
- data/spec/rubocop/cop/style/infinite_loop_spec.rb +48 -0
- data/spec/rubocop/cop/style/method_def_parentheses_spec.rb +3 -1
- data/spec/rubocop/cop/style/multiline_if_then_spec.rb +9 -0
- data/spec/rubocop/cop/style/percent_literal_delimiters_spec.rb +21 -1
- data/spec/rubocop/cop/style/predicate_name_spec.rb +44 -13
- data/spec/rubocop/cop/style/redundant_begin_spec.rb +32 -0
- data/spec/rubocop/cop/style/space_inside_range_literal_spec.rb +52 -0
- data/spec/rubocop/cop/style/symbol_proc_spec.rb +76 -0
- data/spec/rubocop/cop/style/tab_spec.rb +30 -0
- data/spec/rubocop/cop/style/trailing_whitespace_spec.rb +2 -1
- data/spec/rubocop/cop/style/unneeded_capital_w_spec.rb +18 -5
- data/spec/rubocop/cop/style/variable_name_spec.rb +5 -5
- data/spec/rubocop/cop/style/when_then_spec.rb +3 -1
- data/spec/rubocop/cop/style/while_until_do_spec.rb +4 -2
- data/spec/rubocop/cop/util_spec.rb +1 -9
- data/spec/rubocop/cop/variable_force/assignment_spec.rb +2 -15
- data/spec/rubocop/cop/variable_force/locatable_spec.rb +2 -37
- data/spec/rubocop/cop/variable_force/scope_spec.rb +156 -49
- data/spec/rubocop/cop/variable_force/variable_spec.rb +2 -1
- data/spec/rubocop/cop/variable_force_spec.rb +2 -1
- data/spec/rubocop/formatter/emacs_style_formatter_spec.rb +2 -1
- data/spec/rubocop/formatter/html_formatter_spec.rb +145 -0
- data/spec/rubocop/formatter/simple_text_formatter_spec.rb +18 -6
- data/spec/rubocop/options_spec.rb +1 -0
- data/spec/rubocop/path_util_spec.rb +6 -4
- data/spec/rubocop/processed_source_spec.rb +17 -1
- data/spec/rubocop/string_util_spec.rb +46 -0
- metadata +33 -4
- data/spec/support/ast_helper.rb +0 -15
@@ -74,7 +74,9 @@ module RuboCop
|
|
74
74
|
it 'handles pluralization correctly' do
|
75
75
|
formatter.report_summary(0, 0, 0)
|
76
76
|
expect(output.string).to eq(
|
77
|
-
|
77
|
+
['',
|
78
|
+
'0 files inspected, no offenses detected',
|
79
|
+
''].join("\n"))
|
78
80
|
end
|
79
81
|
end
|
80
82
|
|
@@ -82,7 +84,9 @@ module RuboCop
|
|
82
84
|
it 'handles pluralization correctly' do
|
83
85
|
formatter.report_summary(1, 0, 0)
|
84
86
|
expect(output.string).to eq(
|
85
|
-
|
87
|
+
['',
|
88
|
+
'1 file inspected, no offenses detected',
|
89
|
+
''].join("\n"))
|
86
90
|
end
|
87
91
|
end
|
88
92
|
|
@@ -90,7 +94,9 @@ module RuboCop
|
|
90
94
|
it 'handles pluralization correctly' do
|
91
95
|
formatter.report_summary(1, 1, 0)
|
92
96
|
expect(output.string).to eq(
|
93
|
-
|
97
|
+
['',
|
98
|
+
'1 file inspected, 1 offense detected',
|
99
|
+
''].join("\n"))
|
94
100
|
end
|
95
101
|
end
|
96
102
|
|
@@ -98,7 +104,9 @@ module RuboCop
|
|
98
104
|
it 'handles pluralization correctly' do
|
99
105
|
formatter.report_summary(2, 2, 0)
|
100
106
|
expect(output.string).to eq(
|
101
|
-
|
107
|
+
['',
|
108
|
+
'2 files inspected, 2 offenses detected',
|
109
|
+
''].join("\n"))
|
102
110
|
end
|
103
111
|
end
|
104
112
|
|
@@ -106,7 +114,9 @@ module RuboCop
|
|
106
114
|
it 'prints about correction' do
|
107
115
|
formatter.report_summary(1, 1, 1)
|
108
116
|
expect(output.string).to eq(
|
109
|
-
|
117
|
+
['',
|
118
|
+
'1 file inspected, 1 offense detected, 1 offense corrected',
|
119
|
+
''].join("\n"))
|
110
120
|
end
|
111
121
|
end
|
112
122
|
|
@@ -114,7 +124,9 @@ module RuboCop
|
|
114
124
|
it 'handles pluralization correctly' do
|
115
125
|
formatter.report_summary(1, 1, 2)
|
116
126
|
expect(output.string).to eq(
|
117
|
-
|
127
|
+
['',
|
128
|
+
'1 file inspected, 1 offense detected, 2 offenses corrected',
|
129
|
+
''].join("\n"))
|
118
130
|
end
|
119
131
|
end
|
120
132
|
end
|
@@ -33,16 +33,18 @@ describe RuboCop::PathUtil do
|
|
33
33
|
expect(subject.match_path?('dir/**', 'dir/sub/file', '.rubocop.yml'))
|
34
34
|
.to be_truthy
|
35
35
|
expect($stderr.string)
|
36
|
-
.to eq("Warning: Deprecated pattern style 'dir/**' in " \
|
37
|
-
|
36
|
+
.to eq(["Warning: Deprecated pattern style 'dir/**' in " \
|
37
|
+
".rubocop.yml. Change to 'dir/**/*'.",
|
38
|
+
''].join("\n"))
|
38
39
|
end
|
39
40
|
|
40
41
|
it 'matches strings to the basename and prints warning' do
|
41
42
|
expect(subject.match_path?('file', 'dir/file', '.rubocop.yml'))
|
42
43
|
.to be_truthy
|
43
44
|
expect($stderr.string)
|
44
|
-
.to eq("Warning: Deprecated pattern style 'file' in .rubocop.yml. " \
|
45
|
-
|
45
|
+
.to eq(["Warning: Deprecated pattern style 'file' in .rubocop.yml. " \
|
46
|
+
"Change to '**/file'.",
|
47
|
+
''].join("\n"))
|
46
48
|
|
47
49
|
expect(subject.match_path?('file', 'dir/files', '')).to be_falsey
|
48
50
|
expect(subject.match_path?('dir', 'dir/file', '')).to be_falsey
|
@@ -47,7 +47,7 @@ describe RuboCop::ProcessedSource do
|
|
47
47
|
|
48
48
|
describe '#ast' do
|
49
49
|
it 'is the root node of AST' do
|
50
|
-
expect(processed_source.ast).to be_a(
|
50
|
+
expect(processed_source.ast).to be_a(Astrolabe::Node)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -81,6 +81,22 @@ describe RuboCop::ProcessedSource do
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
+
context 'when the source lacks encoding comment and is really utf-8 ' \
|
85
|
+
'encoded but has been read as US-ASCII' do
|
86
|
+
let(:source) do
|
87
|
+
# When files are read into RuboCop, the encoding of source code lacking
|
88
|
+
# an encoding comment will default to the external encoding, which
|
89
|
+
# could for example be US-ASCII if the LC_ALL environment variable is
|
90
|
+
# set to "C".
|
91
|
+
'号码 = 3'.force_encoding('US-ASCII')
|
92
|
+
end
|
93
|
+
|
94
|
+
it 'is nil' do
|
95
|
+
# ProcessedSource#parse sets UTF-8 as default encoding, so no error.
|
96
|
+
expect(processed_source.parser_error).to be_nil
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
84
100
|
context 'when the source could not be parsed due to encoding error' do
|
85
101
|
include_context 'invalid encoding source'
|
86
102
|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
module RuboCop
|
6
|
+
module StringUtil
|
7
|
+
describe Jaro do
|
8
|
+
{
|
9
|
+
%w(foo foo) => 1.000,
|
10
|
+
%w(foo bar) => 0.000,
|
11
|
+
%w(martha marhta) => 0.944,
|
12
|
+
%w(dwayne duane) => 0.822
|
13
|
+
}.each do |strings, expected|
|
14
|
+
context "with #{strings.first.inspect} and #{strings.last.inspect}" do
|
15
|
+
subject(:distance) { Jaro.distance(*strings) }
|
16
|
+
|
17
|
+
it "returns #{expected}" do
|
18
|
+
expect(distance).to be_within(0.001).of(expected)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe JaroWinkler do
|
25
|
+
# These samples are derived from Apache Lucene project.
|
26
|
+
# https://github.com/apache/lucene-solr/blob/lucene_solr_4_9_0/lucene/suggest/src/test/org/apache/lucene/search/spell/TestJaroWinklerDistance.java
|
27
|
+
{
|
28
|
+
%w(al al) => 1.000,
|
29
|
+
%w(martha marhta) => 0.961,
|
30
|
+
%w(jones johnson) => 0.832,
|
31
|
+
%w(abcvwxyz cabvwxyz) => 0.958,
|
32
|
+
%w(dwayne duane) => 0.840,
|
33
|
+
%w(dixon dicksonx) => 0.813,
|
34
|
+
%w(fvie ten) => 0.000
|
35
|
+
}.each do |strings, expected|
|
36
|
+
context "with #{strings.first.inspect} and #{strings.last.inspect}" do
|
37
|
+
subject(:distance) { JaroWinkler.distance(*strings) }
|
38
|
+
|
39
|
+
it "returns #{expected}" do
|
40
|
+
expect(distance).to be_within(0.001).of(expected)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-09-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rainbow
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.0.6
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: astrolabe
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.3'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.3'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: ruby-progressbar
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,6 +187,7 @@ files:
|
|
173
187
|
- LICENSE.txt
|
174
188
|
- README.md
|
175
189
|
- Rakefile
|
190
|
+
- assets/output.html.erb
|
176
191
|
- bin/rubocop
|
177
192
|
- config/default.yml
|
178
193
|
- config/disabled.yml
|
@@ -326,6 +341,7 @@ files:
|
|
326
341
|
- lib/rubocop/cop/style/indent_hash.rb
|
327
342
|
- lib/rubocop/cop/style/indentation_consistency.rb
|
328
343
|
- lib/rubocop/cop/style/indentation_width.rb
|
344
|
+
- lib/rubocop/cop/style/infinite_loop.rb
|
329
345
|
- lib/rubocop/cop/style/inline_comment.rb
|
330
346
|
- lib/rubocop/cop/style/lambda.rb
|
331
347
|
- lib/rubocop/cop/style/lambda_call.rb
|
@@ -386,9 +402,11 @@ files:
|
|
386
402
|
- lib/rubocop/cop/style/space_inside_brackets.rb
|
387
403
|
- lib/rubocop/cop/style/space_inside_hash_literal_braces.rb
|
388
404
|
- lib/rubocop/cop/style/space_inside_parens.rb
|
405
|
+
- lib/rubocop/cop/style/space_inside_range_literal.rb
|
389
406
|
- lib/rubocop/cop/style/special_global_vars.rb
|
390
407
|
- lib/rubocop/cop/style/string_literals.rb
|
391
408
|
- lib/rubocop/cop/style/symbol_array.rb
|
409
|
+
- lib/rubocop/cop/style/symbol_proc.rb
|
392
410
|
- lib/rubocop/cop/style/tab.rb
|
393
411
|
- lib/rubocop/cop/style/trailing_blank_lines.rb
|
394
412
|
- lib/rubocop/cop/style/trailing_comma.rb
|
@@ -422,6 +440,7 @@ files:
|
|
422
440
|
- lib/rubocop/formatter/file_list_formatter.rb
|
423
441
|
- lib/rubocop/formatter/formatter_set.rb
|
424
442
|
- lib/rubocop/formatter/fuubar_style_formatter.rb
|
443
|
+
- lib/rubocop/formatter/html_formatter.rb
|
425
444
|
- lib/rubocop/formatter/json_formatter.rb
|
426
445
|
- lib/rubocop/formatter/offense_count_formatter.rb
|
427
446
|
- lib/rubocop/formatter/progress_formatter.rb
|
@@ -431,6 +450,7 @@ files:
|
|
431
450
|
- lib/rubocop/processed_source.rb
|
432
451
|
- lib/rubocop/rake_task.rb
|
433
452
|
- lib/rubocop/runner.rb
|
453
|
+
- lib/rubocop/string_util.rb
|
434
454
|
- lib/rubocop/target_finder.rb
|
435
455
|
- lib/rubocop/token.rb
|
436
456
|
- lib/rubocop/version.rb
|
@@ -444,6 +464,7 @@ files:
|
|
444
464
|
- relnotes/v0.24.0.md
|
445
465
|
- relnotes/v0.24.1.md
|
446
466
|
- relnotes/v0.25.0.md
|
467
|
+
- relnotes/v0.26.0.md
|
447
468
|
- rubocop.gemspec
|
448
469
|
- spec/.rubocop.yml
|
449
470
|
- spec/isolated_environment_spec.rb
|
@@ -570,6 +591,7 @@ files:
|
|
570
591
|
- spec/rubocop/cop/style/indent_hash_spec.rb
|
571
592
|
- spec/rubocop/cop/style/indentation_consistency_spec.rb
|
572
593
|
- spec/rubocop/cop/style/indentation_width_spec.rb
|
594
|
+
- spec/rubocop/cop/style/infinite_loop_spec.rb
|
573
595
|
- spec/rubocop/cop/style/inline_comment_spec.rb
|
574
596
|
- spec/rubocop/cop/style/lambda_call_spec.rb
|
575
597
|
- spec/rubocop/cop/style/lambda_spec.rb
|
@@ -630,9 +652,11 @@ files:
|
|
630
652
|
- spec/rubocop/cop/style/space_inside_brackets_spec.rb
|
631
653
|
- spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb
|
632
654
|
- spec/rubocop/cop/style/space_inside_parens_spec.rb
|
655
|
+
- spec/rubocop/cop/style/space_inside_range_literal_spec.rb
|
633
656
|
- spec/rubocop/cop/style/special_global_vars_spec.rb
|
634
657
|
- spec/rubocop/cop/style/string_literals_spec.rb
|
635
658
|
- spec/rubocop/cop/style/symbol_array_spec.rb
|
659
|
+
- spec/rubocop/cop/style/symbol_proc_spec.rb
|
636
660
|
- spec/rubocop/cop/style/tab_spec.rb
|
637
661
|
- spec/rubocop/cop/style/trailing_blank_lines_spec.rb
|
638
662
|
- spec/rubocop/cop/style/trailing_comma_spec.rb
|
@@ -664,6 +688,7 @@ files:
|
|
664
688
|
- spec/rubocop/formatter/file_list_formatter_spec.rb
|
665
689
|
- spec/rubocop/formatter/formatter_set_spec.rb
|
666
690
|
- spec/rubocop/formatter/fuubar_style_formatter_spec.rb
|
691
|
+
- spec/rubocop/formatter/html_formatter_spec.rb
|
667
692
|
- spec/rubocop/formatter/json_formatter_spec.rb
|
668
693
|
- spec/rubocop/formatter/offense_count_formatter_spec.rb
|
669
694
|
- spec/rubocop/formatter/progress_formatter_spec.rb
|
@@ -672,10 +697,10 @@ files:
|
|
672
697
|
- spec/rubocop/path_util_spec.rb
|
673
698
|
- spec/rubocop/processed_source_spec.rb
|
674
699
|
- spec/rubocop/runner_spec.rb
|
700
|
+
- spec/rubocop/string_util_spec.rb
|
675
701
|
- spec/rubocop/target_finder_spec.rb
|
676
702
|
- spec/rubocop/token_spec.rb
|
677
703
|
- spec/spec_helper.rb
|
678
|
-
- spec/support/ast_helper.rb
|
679
704
|
- spec/support/file_helper.rb
|
680
705
|
- spec/support/isolated_environment.rb
|
681
706
|
- spec/support/mri_syntax_checker.rb
|
@@ -833,6 +858,7 @@ test_files:
|
|
833
858
|
- spec/rubocop/cop/style/indent_hash_spec.rb
|
834
859
|
- spec/rubocop/cop/style/indentation_consistency_spec.rb
|
835
860
|
- spec/rubocop/cop/style/indentation_width_spec.rb
|
861
|
+
- spec/rubocop/cop/style/infinite_loop_spec.rb
|
836
862
|
- spec/rubocop/cop/style/inline_comment_spec.rb
|
837
863
|
- spec/rubocop/cop/style/lambda_call_spec.rb
|
838
864
|
- spec/rubocop/cop/style/lambda_spec.rb
|
@@ -893,9 +919,11 @@ test_files:
|
|
893
919
|
- spec/rubocop/cop/style/space_inside_brackets_spec.rb
|
894
920
|
- spec/rubocop/cop/style/space_inside_hash_literal_braces_spec.rb
|
895
921
|
- spec/rubocop/cop/style/space_inside_parens_spec.rb
|
922
|
+
- spec/rubocop/cop/style/space_inside_range_literal_spec.rb
|
896
923
|
- spec/rubocop/cop/style/special_global_vars_spec.rb
|
897
924
|
- spec/rubocop/cop/style/string_literals_spec.rb
|
898
925
|
- spec/rubocop/cop/style/symbol_array_spec.rb
|
926
|
+
- spec/rubocop/cop/style/symbol_proc_spec.rb
|
899
927
|
- spec/rubocop/cop/style/tab_spec.rb
|
900
928
|
- spec/rubocop/cop/style/trailing_blank_lines_spec.rb
|
901
929
|
- spec/rubocop/cop/style/trailing_comma_spec.rb
|
@@ -927,6 +955,7 @@ test_files:
|
|
927
955
|
- spec/rubocop/formatter/file_list_formatter_spec.rb
|
928
956
|
- spec/rubocop/formatter/formatter_set_spec.rb
|
929
957
|
- spec/rubocop/formatter/fuubar_style_formatter_spec.rb
|
958
|
+
- spec/rubocop/formatter/html_formatter_spec.rb
|
930
959
|
- spec/rubocop/formatter/json_formatter_spec.rb
|
931
960
|
- spec/rubocop/formatter/offense_count_formatter_spec.rb
|
932
961
|
- spec/rubocop/formatter/progress_formatter_spec.rb
|
@@ -935,10 +964,10 @@ test_files:
|
|
935
964
|
- spec/rubocop/path_util_spec.rb
|
936
965
|
- spec/rubocop/processed_source_spec.rb
|
937
966
|
- spec/rubocop/runner_spec.rb
|
967
|
+
- spec/rubocop/string_util_spec.rb
|
938
968
|
- spec/rubocop/target_finder_spec.rb
|
939
969
|
- spec/rubocop/token_spec.rb
|
940
970
|
- spec/spec_helper.rb
|
941
|
-
- spec/support/ast_helper.rb
|
942
971
|
- spec/support/file_helper.rb
|
943
972
|
- spec/support/isolated_environment.rb
|
944
973
|
- spec/support/mri_syntax_checker.rb
|
data/spec/support/ast_helper.rb
DELETED
@@ -1,15 +0,0 @@
|
|
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
|