rubocop-junit-formatter 0.1.1 → 0.1.3

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: 2f46ce11741763314e5103f1285b5a0d6ac32f33
4
- data.tar.gz: 276fa6928e20d708ff6aecf87707d74a3845b37b
3
+ metadata.gz: 069727f793c3b467b7e7c6352da02d5a9f868092
4
+ data.tar.gz: d8eee34af88126df93913965667879f9b9fdc3db
5
5
  SHA512:
6
- metadata.gz: 5b0b119566ef356ee8f8e63f82c0df2512db0cd5ef60a12ca38d455a97e1a36bf983de82ff1856b20745d631addb24c2296d7bfd181c33a9e93adcd220fd1bed
7
- data.tar.gz: 0a25b6bd5e5396ca481e6a004dfd5b2494412a0f843a5a31505a2c70e8bded8742f0c31044c280d19aade00d365b8c56718199ccc7df5fc9e7cf5a769a20900e
6
+ metadata.gz: 1a5d034fe2297f504b239c497a029ee08fb699e178a94ee7cd153b27cdc80853c6f13c0ab00a6f4812fd7eb3d89f64ed53dd75d9a1a8cd27c9387ad2e8909888
7
+ data.tar.gz: c40f146c33310a020d9776ae75eda2454951b2007576c12362eb67253600534263e98009a6f044ab9937b9ffad959bedd7a905bca5e8cc69a2e59dc15e5dd8f6
@@ -3,6 +3,11 @@ require 'rexml/document'
3
3
  module RuboCop
4
4
  module Formatter
5
5
  class JUnitFormatter < BaseFormatter
6
+
7
+ # This gives all cops - we really want all _enabled_ cops, but
8
+ # that is difficult to obtain - no access to config object here.
9
+ COPS = Cop::Cop.all
10
+
6
11
  def started(target_file)
7
12
  @document = REXML::Document.new.tap do |d|
8
13
  d << REXML::XMLDecl.new
@@ -16,14 +21,17 @@ module RuboCop
16
21
  def file_finished(file, offences)
17
22
  return if offences.empty?
18
23
 
19
- offences.group_by(&:cop_name).each do |cop, cop_offences|
24
+ # One test case per cop per file
25
+ COPS.each do |cop|
20
26
  REXML::Element.new('testcase', @testsuite).tap do |f|
21
27
  f.attributes['classname'] = file.gsub(/\.rb\Z/, '').gsub("#{Dir.pwd}/", '').gsub('/', '.')
22
- f.attributes['name'] = cop
23
-
24
- cop_offences.each do |offence|
28
+ f.attributes['name'] = cop.cop_name
29
+
30
+ # One failure per offence. Zero failures is a passing test case,
31
+ # for most surefire/nUnit parsers.
32
+ offences.select {|offence| offence.cop_name == cop.cop_name}.each do |offence|
25
33
  REXML::Element.new('failure', f).tap do |e|
26
- e.attributes['type'] = cop
34
+ e.attributes['type'] = cop.cop_name
27
35
  e.attributes['message'] = offence.message
28
36
  e.add_text offence.location.to_s
29
37
  end
@@ -4,12 +4,12 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "rubocop-junit-formatter"
7
- spec.version = '0.1.1'
7
+ spec.version = '0.1.3'
8
8
  spec.authors = ["Mikko Kokkonen"]
9
- spec.email = ["mikko@owlforestry.com"]
9
+ spec.email = ["mikko@mikian.com"]
10
10
  spec.summary = %q{Outputs RuboCop Offences as JUnit report}
11
11
  spec.description = %q{Allows neat integration with Atlassian Bamboo by listing all offences as failed JUnit testcase}
12
- spec.homepage = ""
12
+ spec.homepage = "https://github.com/mikian/rubocop-junit-formatter"
13
13
  spec.license = "MIT"
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-junit-formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikko Kokkonen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-05 00:00:00.000000000 Z
11
+ date: 2015-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -41,7 +41,7 @@ dependencies:
41
41
  description: Allows neat integration with Atlassian Bamboo by listing all offences
42
42
  as failed JUnit testcase
43
43
  email:
44
- - mikko@owlforestry.com
44
+ - mikko@mikian.com
45
45
  executables: []
46
46
  extensions: []
47
47
  extra_rdoc_files: []
@@ -53,7 +53,7 @@ files:
53
53
  - Rakefile
54
54
  - lib/rubocop/formatter/junit_formatter.rb
55
55
  - rubocop-junit-formatter.gemspec
56
- homepage: ''
56
+ homepage: https://github.com/mikian/rubocop-junit-formatter
57
57
  licenses:
58
58
  - MIT
59
59
  metadata: {}
@@ -73,9 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  requirements: []
75
75
  rubyforge_project:
76
- rubygems_version: 2.2.2
76
+ rubygems_version: 2.4.5
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: Outputs RuboCop Offences as JUnit report
80
80
  test_files: []
81
- has_rdoc: