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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c6e0b676bbe0a4534cea363f53180ae8149594d
4
- data.tar.gz: deac4b1ec847688ded1bb407dc10fc497d3282de
3
+ metadata.gz: 45e5162ca9378cfe0aa9425673ae92f0475d7741
4
+ data.tar.gz: d651dd7de4451f2a54362b58fec4f953590540b0
5
5
  SHA512:
6
- metadata.gz: 849e8ff67f54945206f80bf763edfbbb4f5319dca0a16ce01827c2c4f2b2780f0dfc161f2250f22c09c290b9573f6fe468c5d1cce83ab6f5da7569d9521976de
7
- data.tar.gz: e1454450feba2911517b8ceb1f0875f596eaad66471bcec4924ebf85d9e5f3e153316e12724daef6541703d3e1ab498ddb1fd718f9a0c1cd5bb68d4709933a1b
6
+ metadata.gz: 5f928658ca7e3ac003631cddc2c5105de0bb6da390b76a403e7e7665fd21fa459193f8f4af06ea8e8a6cc09855dd46684d773b3f53bc5b09c426315b7d28311c
7
+ data.tar.gz: 2317afa4b0c922722d25f346f283a641e9435a4e3499d4a35443ae35d67d3c86374b674c75ebd3c8f522c973d6d7130207981de7b8dec3e0253b3b5424462dd7
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # PmdTranslateCheckstyleFormat
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/pmd_translate_checkstyle_format`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
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
- TODO: Write usage instructions here
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}\\n#{violation.attributes['externalInfoUrl']}"
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
@@ -1,3 +1,3 @@
1
1
  module PmdTranslateCheckstyleFormat
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  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.0
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-08-31 00:00:00.000000000 Z
11
+ date: 2015-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor