pronto-findbugs 1.0.0 → 1.0.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
- SHA256:
3
- metadata.gz: 52d5e68bb13e74b62be1bf90f96841a45464d5ffb38bc8b8e0bb2eaa98292d83
4
- data.tar.gz: 9f80fdfea3252589a5e9315cf672ec47bae6824f1bbbb11e88edf2e1a8ffb7ae
2
+ SHA1:
3
+ metadata.gz: 02210d2fbe8cb95971d95e47f84be0b61caa875d
4
+ data.tar.gz: bdea5a302aead013636a86ef3e5c2923a3d20e20
5
5
  SHA512:
6
- metadata.gz: d07b82333ff9f53fa4ab4d16714e8aa1c7135cea2946a58fb4a0ae512fd47d70e0c46da38cfd5a1a07c87e15273dfac1e0fe9f8b28b8dca00efdeb3ded60282c
7
- data.tar.gz: 3e0d8b6bdb19e66f5ef2cdfc6cd806fd0679abe6bfd6655ab01ecdf96c9d7156ee52d60fd9f354f7171a97d0cf874f61f6780a57a8119d7b600bba008690f928
6
+ metadata.gz: e1abd396416a7bdde43f19dc380f0e6789a52c4b4a55d1a0bea9c0781f9a7fb41966b2f54757301815bd77e36b723ac78288acbadec69e7df3df60544f98b99b
7
+ data.tar.gz: 4651a51e8b326815a62efdda73bd501a53247ace7a8ee650249de690d1c37fef1a3d54f2666e0bfb30b40c4193d619e8dc802850ad8714d51ddb3f5cd8beb2cc
data/README.md CHANGED
@@ -14,6 +14,8 @@ You need to specify location of findbugs reports by passing `PRONTO_FINDBUGS_REP
14
14
  PRONTO_FINDBUGS_REPORTS_DIR=build/reports/spotbugs/ pronto run --index
15
15
  ```
16
16
 
17
+ See [seikichi/pronto-checkstyle-findbugs-example](https://github.com/seikichi/pronto-checkstyle-findbugs-example) for more details.
18
+
17
19
  ## Installation
18
20
 
19
21
  Add this line to your application's Gemfile:
@@ -17,7 +17,7 @@ module Pronto
17
17
  Offence = Struct.new(:path, :line, :message)
18
18
 
19
19
  def findbugs_reports_dir
20
- ENV['PRONTO_FINDBUGS_REPORTS_DIR'] || (raise 'Please set `PRONT_FINDBUGS_REPORTS_DIR` to use pronto-findbugs')
20
+ ENV['PRONTO_FINDBUGS_REPORTS_DIR'] || (raise 'Please set `PRONTO_FINDBUGS_REPORTS_DIR` to use pronto-findbugs')
21
21
  end
22
22
 
23
23
  def valid_patch?(patch)
@@ -47,10 +47,12 @@ module Pronto
47
47
  src_dirs = REXML::XPath.match(doc, '/BugCollection/Project/SrcDir/text()')
48
48
  return [] if src_dirs.empty?
49
49
 
50
- src = src_dirs.first.to_s
51
50
  REXML::XPath.match(doc, '/BugCollection/BugInstance').map do |bug|
52
- Offence.new(path_from(bug, src), line_from(bug), message_from(bug))
53
- end
51
+ src = src_dirs.find { |s| File.exist?(path_from(bug, s.to_s)) }
52
+ next unless src
53
+
54
+ Offence.new(path_from(bug, src.to_s), line_from(bug), message_from(bug))
55
+ end.compact
54
56
  end
55
57
 
56
58
  def path_from(bug_node, root)
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module FindbugsVersion
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-findbugs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seiichi KONDO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-21 00:00:00.000000000 Z
11
+ date: 2020-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pronto
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.7.6
154
+ rubygems_version: 2.5.2.1
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Pronto runner for findbugs / spotbugs