File tree 4 files changed +25
-19
lines changed
4 files changed +25
-19
lines changed Original file line number Diff line number Diff line change
1
+ AllCops :
2
+ TargetRubyVersion : 2.2
3
+
1
4
Metrics/ModuleLength :
2
5
Exclude :
3
6
- ' spec/**/*'
Original file line number Diff line number Diff line change 1
1
source 'https://rubygems.org'
2
2
3
3
gem "activesupport" , require : false
4
- gem "rubocop" , require : false
4
+ gem "rubocop" , "~> 0.36.0" , require : false
5
5
gem "rubocop-rspec" , require : false
6
6
gem "safe_yaml"
7
7
gem "pry" , require : false
Original file line number Diff line number Diff line change 1
1
GEM
2
2
remote: https://rubygems.org/
3
3
specs:
4
- activesupport (4.2.4 )
4
+ activesupport (4.2.5.1 )
5
5
i18n (~> 0.7 )
6
6
json (~> 1.7 , >= 1.7.7 )
7
7
minitest (~> 5.1 )
8
8
thread_safe (~> 0.3 , >= 0.3.4 )
9
9
tzinfo (~> 1.1 )
10
10
ansi (1.5.0 )
11
11
ast (2.2.0 )
12
- astrolabe (1.3.1 )
13
- parser (~> 2.2 )
14
12
builder (3.2.2 )
15
13
coderay (1.1.0 )
16
14
i18n (0.7.0 )
17
15
json (1.8.3 )
18
16
metaclass (0.0.4 )
19
17
method_source (0.8.2 )
20
- minitest (5.8.0 )
21
- minitest-reporters (1.0.20 )
18
+ minitest (5.8.4 )
19
+ minitest-reporters (1.1.7 )
22
20
ansi
23
21
builder
24
22
minitest (>= 5.0 )
25
23
ruby-progressbar
26
24
mocha (1.1.0 )
27
25
metaclass (~> 0.0.1 )
28
- parser (2.2. 3.0 )
29
- ast (>= 1.1 , < 3.0 )
26
+ parser (2.3.0.2 )
27
+ ast (~> 2.2 )
30
28
powerpack (0.1.1 )
31
- pry (0.10.1 )
29
+ pry (0.10.3 )
32
30
coderay (~> 1.1.0 )
33
31
method_source (~> 0.8.1 )
34
32
slop (~> 3.4 )
35
- rainbow (2.0.0 )
36
- rake (10.4.2 )
37
- rubocop (0.35.1 )
38
- astrolabe (~> 1.3 )
39
- parser (>= 2.2.3.0 , < 3.0 )
33
+ rainbow (2.1.0 )
34
+ rake (10.5.0 )
35
+ rubocop (0.36.0 )
36
+ parser (>= 2.3.0.0 , < 3.0 )
40
37
powerpack (~> 0.1 )
41
38
rainbow (>= 1.99.1 , < 3.0 )
42
39
ruby-progressbar (~> 1.7 )
43
- tins (<= 1.6.0 )
44
- rubocop-rspec (1.3.0 )
40
+ rubocop-rspec (1.3.1 )
45
41
ruby-progressbar (1.7.5 )
46
42
safe_yaml (1.0.4 )
47
43
slop (3.6.0 )
48
44
thread_safe (0.3.5 )
49
- tins (1.6.0 )
50
45
tzinfo (1.2.2 )
51
46
thread_safe (~> 0.1 )
52
47
@@ -60,6 +55,9 @@ DEPENDENCIES
60
55
mocha
61
56
pry
62
57
rake
63
- rubocop
58
+ rubocop ( ~> 0.36.0 )
64
59
rubocop-rspec
65
60
safe_yaml
61
+
62
+ BUNDLED WITH
63
+ 1.11.2
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def category(cop_name)
43
43
end
44
44
45
45
def inspect_file ( path )
46
- parsed = RuboCop ::ProcessedSource . from_file ( path )
46
+ parsed = RuboCop ::ProcessedSource . from_file ( path , target_ruby_version ( path ) )
47
47
rubocop_team_for_path ( path ) . inspect_file ( parsed ) . each do |violation |
48
48
next if violation . disabled?
49
49
decorated_violation = ViolationDecorator . new ( violation )
@@ -74,6 +74,11 @@ def rubocop_team_for_path(path)
74
74
RuboCop ::Cop ::Team . new ( RuboCop ::Cop ::Cop . all , rubocop_config )
75
75
end
76
76
77
+ def target_ruby_version ( path )
78
+ config_store = rubocop_config_store . for ( path )
79
+ config_store [ "AllCops" ] && config_store [ "AllCops" ] [ "TargetRubyVersion" ]
80
+ end
81
+
77
82
def violation_positions ( location )
78
83
if location . is_a? ( RuboCop ::Cop ::Lint ::Syntax ::PseudoSourceRange )
79
84
first_line = location . line
You can’t perform that action at this time.
0 commit comments