codegrade 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/codegrade/formatter.rb +5 -5
- data/lib/codegrade/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3f97d6f359d7a7824488726ec14892a4c778a36
|
4
|
+
data.tar.gz: d8e59033abb79029c90973ee25ddaa8f0f54bbcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22f7e8f35b332449f38a35f2be9c763dc13b5c89537216acba802058c7388f5e2bb24c7ed3241abf05860e7f91057b61fd78fc1b062b079dc6e826260ac87c33
|
7
|
+
data.tar.gz: 08e28c8822b235674ff9c7c3c5a7baa9415b999adf0f1326b08e59a1e7ead60d4b6fd4d6087174ff68b48b992bf784cc3e0271290f9de6ea9ea73036f55c24e7
|
data/lib/codegrade/formatter.rb
CHANGED
@@ -5,7 +5,7 @@ module Codegrade
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def print
|
8
|
-
|
8
|
+
group_by_files
|
9
9
|
working_directory = File.expand_path('.')
|
10
10
|
|
11
11
|
@categories.each do |category, offenses|
|
@@ -14,7 +14,7 @@ module Codegrade
|
|
14
14
|
|
15
15
|
offenses.each do |offense|
|
16
16
|
file = offense.file.gsub(working_directory, '') unless offense.file.nil?
|
17
|
-
puts "- #{
|
17
|
+
puts "- #{offense.line_number}:#{offense.column_number} #{offense.category}"
|
18
18
|
end
|
19
19
|
|
20
20
|
puts
|
@@ -23,12 +23,12 @@ module Codegrade
|
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
|
-
def
|
26
|
+
def group_by_files
|
27
27
|
@categories = Hash.new
|
28
28
|
|
29
29
|
@offenses.each do |offense|
|
30
|
-
@categories[offense.
|
31
|
-
@categories[offense.
|
30
|
+
@categories[offense.file] ||= []
|
31
|
+
@categories[offense.file].push(offense)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
data/lib/codegrade/version.rb
CHANGED