pmd_translate_checkstyle_format 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -3
- data/lib/pmd_translate_checkstyle_format/translate.rb +13 -2
- data/lib/pmd_translate_checkstyle_format/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45e5162ca9378cfe0aa9425673ae92f0475d7741
|
4
|
+
data.tar.gz: d651dd7de4451f2a54362b58fec4f953590540b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f928658ca7e3ac003631cddc2c5105de0bb6da390b76a403e7e7665fd21fa459193f8f4af06ea8e8a6cc09855dd46684d773b3f53bc5b09c426315b7d28311c
|
7
|
+
data.tar.gz: 2317afa4b0c922722d25f346f283a641e9435a4e3499d4a35443ae35d67d3c86374b674c75ebd3c8f522c973d6d7130207981de7b8dec3e0253b3b5424462dd7
|
data/README.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# PmdTranslateCheckstyleFormat
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/pmd_translate_checkstyle_format.svg)](http://badge.fury.io/rb/pmd_translate_checkstyle_format)
|
4
|
+
[![Build Status](https://travis-ci.org/noboru-i/pmd_translate_checkstyle_format.svg?branch=master)](https://travis-ci.org/noboru-i/pmd_translate_checkstyle_format)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/noboru-i/pmd_translate_checkstyle_format/badges/gpa.svg)](https://codeclimate.com/github/noboru-i/pmd_translate_checkstyle_format)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/noboru-i/pmd_translate_checkstyle_format/badge.svg)](https://coveralls.io/r/noboru-i/pmd_translate_checkstyle_format)
|
4
7
|
|
5
|
-
|
8
|
+
Translate pmd format into checkstyle format.
|
6
9
|
|
7
10
|
## Installation
|
8
11
|
|
@@ -22,7 +25,17 @@ Or install it yourself as:
|
|
22
25
|
|
23
26
|
## Usage
|
24
27
|
|
25
|
-
|
28
|
+
### Use pipe
|
29
|
+
|
30
|
+
```
|
31
|
+
cat pmd.xml | pmd_translate_checkstyle_format translate
|
32
|
+
```
|
33
|
+
|
34
|
+
### Use command-line option
|
35
|
+
|
36
|
+
```
|
37
|
+
pmd_translate_checkstyle_format translate --file="pmd.xml"
|
38
|
+
```
|
26
39
|
|
27
40
|
## Development
|
28
41
|
|
@@ -31,13 +31,24 @@ module PmdTranslateCheckstyleFormat
|
|
31
31
|
})
|
32
32
|
file_element.add_element("error", {
|
33
33
|
'line' => violation.attributes['beginline'],
|
34
|
-
'severity' => '',
|
35
|
-
'message' => "[#{violation.attributes['rule']}] #{violation.strip}
|
34
|
+
'severity' => get_severity(violation.attributes['priority'].to_i),
|
35
|
+
'message' => "[#{violation.attributes['rule']}] #{violation.strip}\n#{violation.attributes['externalInfoUrl']}"
|
36
36
|
})
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
doc
|
41
41
|
end
|
42
|
+
|
43
|
+
def get_severity(priority)
|
44
|
+
case priority
|
45
|
+
when 1, 2
|
46
|
+
'error'
|
47
|
+
when 3, 4
|
48
|
+
'warning'
|
49
|
+
when 5
|
50
|
+
'info'
|
51
|
+
end
|
52
|
+
end
|
42
53
|
end
|
43
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pmd_translate_checkstyle_format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- noboru-i
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|