findbugs_translate_checkstyle_format 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cc85e4f04e51abab5122a929bd8b8ff44c230e7
4
- data.tar.gz: 5992c4e2355e9d99df085dd98bdc834093d28778
3
+ metadata.gz: a69d0847aa30321eeca23a3d61dbca9555571fd6
4
+ data.tar.gz: 3ade928a9aa98c29306cf934c9fdbd373cb93153
5
5
  SHA512:
6
- metadata.gz: b224f85dfbf36a6a5a248671ce977aa758c26fd6951c2498ac89124e8f100a72266e71a27314c22bc108fafecd170ab51a968556a56d29faeea9426bd4a4519e
7
- data.tar.gz: 8033f099bb589646b02c21357d94682c2878be8ad200296568966c0e3ee77c9a9afce6939b4341e80cded937bd3411acc93725d59f0ee0ea783285310b2dad14
6
+ metadata.gz: 1319f100167186f355706b349bab0db432e597bcdca80ced0118eb5da0b040da8a052cdde88737d040b7b5693705fdd0a405acd6e8451a670363ab05bba5f3de
7
+ data.tar.gz: 2a549e105c3d3d358bd98a00014548f1050e4b959856bb3203ef5ea3e76726bbc57db8bf6b0143a938eeb6532614bb7193417f765cf72e5048f3c6c23f06e865
@@ -10,7 +10,6 @@ module FindbugsTranslateCheckstyleFormat
10
10
  data = fetch_data(options)
11
11
  xml = parse(data)
12
12
  checkstyle = trans(xml)
13
- return unless checkstyle
14
13
  checkstyle.write(STDOUT, 2)
15
14
  end
16
15
 
@@ -9,21 +9,22 @@ module FindbugsTranslateCheckstyleFormat
9
9
  end
10
10
 
11
11
  def trans(xml)
12
- return nil unless xml['BugCollection']['BugInstance']
13
12
  require 'rexml/document'
14
13
  doc = REXML::Document.new
15
14
  doc << REXML::XMLDecl.new('1.0', 'UTF-8')
16
15
 
17
16
  checkstyle = doc.add_element("checkstyle")
18
- xml['BugCollection']['BugInstance'].each do |bugInstance|
19
- file = checkstyle.add_element("file", {
20
- 'name' => fqcn_to_path(bugInstance['SourceLine']['@classname'], xml)
21
- })
22
- file.add_element("error", {
23
- 'line' => bugInstance['SourceLine']['@start'],
24
- 'severity' => '',
25
- 'message' => "[#{bugInstance['@category']}] #{bugInstance['LongMessage']}"
26
- })
17
+ if xml['BugCollection']['BugInstance']
18
+ xml['BugCollection']['BugInstance'].each do |bugInstance|
19
+ file = checkstyle.add_element("file", {
20
+ 'name' => fqcn_to_path(bugInstance['SourceLine']['@classname'], xml)
21
+ })
22
+ file.add_element("error", {
23
+ 'line' => bugInstance['SourceLine']['@start'],
24
+ 'severity' => '',
25
+ 'message' => "[#{bugInstance['@category']}] #{bugInstance['LongMessage']}"
26
+ })
27
+ end
27
28
  end
28
29
 
29
30
  doc
@@ -1,3 +1,3 @@
1
1
  module FindbugsTranslateCheckstyleFormat
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: findbugs_translate_checkstyle_format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
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-06-11 00:00:00.000000000 Z
11
+ date: 2015-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor