File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -151,11 +151,11 @@ def file_to_exclude?(file)
151
151
end
152
152
153
153
def patterns_to_include
154
- self [ 'AllCops' ] [ 'Include' ]
154
+ @patterns_to_include ||= self [ 'AllCops' ] [ 'Include' ]
155
155
end
156
156
157
157
def patterns_to_exclude
158
- self [ 'AllCops' ] [ 'Exclude' ]
158
+ @patterns_to_exclude ||= self [ 'AllCops' ] [ 'Exclude' ]
159
159
end
160
160
161
161
def path_relative_to_config ( path )
Original file line number Diff line number Diff line change @@ -8,6 +8,14 @@ module Formatter
8
8
class ProgressFormatter < ClangStyleFormatter
9
9
include TextUtil
10
10
11
+ DOT = '.' . freeze
12
+ GREEN_DOT = Rainbow ( DOT ) . green . freeze
13
+
14
+ def initialize ( output )
15
+ super
16
+ @dot = @output . tty? ? GREEN_DOT : DOT
17
+ end
18
+
11
19
def started ( target_files )
12
20
super
13
21
@offenses_for_files = { }
@@ -36,14 +44,14 @@ def finished(inspected_files)
36
44
end
37
45
end
38
46
39
- report_summary ( inspected_files . count ,
47
+ report_summary ( inspected_files . size ,
40
48
@total_offense_count ,
41
49
@total_correction_count )
42
50
end
43
51
44
52
def report_file_as_mark ( offenses )
45
53
mark = if offenses . empty?
46
- green ( '.' )
54
+ @dot
47
55
else
48
56
highest_offense = offenses . max_by ( &:severity )
49
57
colored_severity_code ( highest_offense )
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def disabled_line_ranges
44
44
def lines
45
45
@lines ||= begin
46
46
all_lines = raw_source . lines . map ( &:chomp )
47
- last_token_line = tokens . any? ? tokens . last . pos . line : all_lines . count
47
+ last_token_line = tokens . any? ? tokens . last . pos . line : all_lines . size
48
48
result = [ ]
49
49
all_lines . each_with_index do |line , ix |
50
50
break if ix >= last_token_line && line == '__END__'
You can’t perform that action at this time.
0 commit comments