pronto 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +2 -0
- data/lib/pronto.rb +1 -0
- data/lib/pronto/formatter/checkstyle_formatter.rb +63 -0
- data/lib/pronto/formatter/formatter.rb +1 -0
- data/lib/pronto/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d85ffaed02fa2f49086a92e01633f8bc60e4ee2d
|
4
|
+
data.tar.gz: 379414ffc3b8c96e02a28b61a13c69aa09759fd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb2afdea289a79e12e905ccd593edfd9112c1cfe7ac76c60c814f857af49e47866279f3117d9d5e517eefc790682c4218feb2414a4312bee6688fde44a6626aa
|
7
|
+
data.tar.gz: f636ae3b8d131e2640b0076e4797a8cfb6a6e2d9e901d09420d06400882fe7db66b9ffe273c1f1104c039931a5517ea84bb7dc17e6c609088f2281fff5410689
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -60,7 +60,9 @@ Currently available runners:
|
|
60
60
|
* [pronto-rubocop](https://github.com/mmozuras/pronto-rubocop)
|
61
61
|
* [pronto-flay](https://github.com/mmozuras/pronto-flay)
|
62
62
|
* [pronto-brakeman](https://github.com/mmozuras/pronto-brakeman)
|
63
|
+
* [pronto-foodcritic](https://github.com/mmozuras/pronto-foodcritic)
|
63
64
|
* [pronto-rails_best_practices](https://github.com/mmozuras/pronto-rails_best_practices)
|
65
|
+
* [pronto-reek](https://github.com/mmozuras/pronto-reek)
|
64
66
|
* [pronto-poper](https://github.com/mmozuras/pronto-poper)
|
65
67
|
* [pronto-jshint](https://github.com/mmozuras/pronto-jshint)
|
66
68
|
* [pronto-spell](https://github.com/mmozuras/pronto-spell)
|
data/lib/pronto.rb
CHANGED
@@ -15,6 +15,7 @@ require 'pronto/runner'
|
|
15
15
|
require 'pronto/formatter/text_formatter'
|
16
16
|
require 'pronto/formatter/json_formatter'
|
17
17
|
require 'pronto/formatter/github_formatter'
|
18
|
+
require 'pronto/formatter/checkstyle_formatter'
|
18
19
|
require 'pronto/formatter/formatter'
|
19
20
|
|
20
21
|
module Pronto
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'rexml/document'
|
2
|
+
|
3
|
+
module Pronto
|
4
|
+
module Formatter
|
5
|
+
class CheckstyleFormatter
|
6
|
+
def initialize
|
7
|
+
@output = ''
|
8
|
+
end
|
9
|
+
|
10
|
+
def format(messages, _)
|
11
|
+
open_xml
|
12
|
+
process_messages(messages)
|
13
|
+
close_xml
|
14
|
+
|
15
|
+
@output
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def open_xml
|
21
|
+
@document = REXML::Document.new.tap do |d|
|
22
|
+
d << REXML::XMLDecl.new
|
23
|
+
end
|
24
|
+
@checkstyle = REXML::Element.new('checkstyle', @document)
|
25
|
+
end
|
26
|
+
|
27
|
+
def process_messages(messages)
|
28
|
+
group_messages(messages).map do |path, path_messages|
|
29
|
+
REXML::Element.new('file', @checkstyle).tap do |file|
|
30
|
+
file.attributes['name'] = path
|
31
|
+
add_file_messages(path_messages, file)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def group_messages(messages)
|
37
|
+
messages.group_by { |message| message.path }
|
38
|
+
end
|
39
|
+
|
40
|
+
def add_file_messages(path_messages, file)
|
41
|
+
path_messages.each do |message|
|
42
|
+
REXML::Element.new('error', file).tap do |e|
|
43
|
+
e.attributes['line'] = message.line.new_lineno if message.line
|
44
|
+
e.attributes['severity'] = to_checkstyle_severity(message.level)
|
45
|
+
e.attributes['message'] = message.msg
|
46
|
+
e.attributes['source'] = 'com.puppycrawl.tools.checkstyle.pronto'
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def close_xml
|
52
|
+
@document.write(@output, 2)
|
53
|
+
end
|
54
|
+
|
55
|
+
def to_checkstyle_severity(pronto_level)
|
56
|
+
case pronto_level
|
57
|
+
when :error, :fatal then 'error'
|
58
|
+
else pronto_level.to_s
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/lib/pronto/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindaugas Mozūras
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|
@@ -101,7 +101,12 @@ executables:
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
+
- LICENSE
|
105
|
+
- README.md
|
106
|
+
- bin/pronto
|
107
|
+
- lib/pronto.rb
|
104
108
|
- lib/pronto/cli.rb
|
109
|
+
- lib/pronto/formatter/checkstyle_formatter.rb
|
105
110
|
- lib/pronto/formatter/formatter.rb
|
106
111
|
- lib/pronto/formatter/github_formatter.rb
|
107
112
|
- lib/pronto/formatter/json_formatter.rb
|
@@ -110,19 +115,15 @@ files:
|
|
110
115
|
- lib/pronto/plugin.rb
|
111
116
|
- lib/pronto/rake_task/travis_pull_request.rb
|
112
117
|
- lib/pronto/rugged/commit.rb
|
118
|
+
- lib/pronto/rugged/diff.rb
|
113
119
|
- lib/pronto/rugged/diff/delta.rb
|
114
120
|
- lib/pronto/rugged/diff/line.rb
|
115
121
|
- lib/pronto/rugged/diff/patch.rb
|
116
|
-
- lib/pronto/rugged/diff.rb
|
117
122
|
- lib/pronto/rugged/remote.rb
|
118
123
|
- lib/pronto/rugged/repository.rb
|
119
124
|
- lib/pronto/rugged/tree.rb
|
120
125
|
- lib/pronto/runner.rb
|
121
126
|
- lib/pronto/version.rb
|
122
|
-
- lib/pronto.rb
|
123
|
-
- LICENSE
|
124
|
-
- README.md
|
125
|
-
- bin/pronto
|
126
127
|
homepage: http://github.org/mmozuras/pronto
|
127
128
|
licenses:
|
128
129
|
- MIT
|
@@ -143,9 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
144
|
version: 1.3.6
|
144
145
|
requirements: []
|
145
146
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.2.2
|
147
148
|
signing_key:
|
148
149
|
specification_version: 4
|
149
150
|
summary: Pronto runs analysis quickly by checking only the introduced changes
|
150
151
|
test_files: []
|
151
|
-
has_rdoc:
|