danger-spotbugs 0.0.2 → 0.0.3
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 +4 -4
- data/Gemfile.lock +8 -4
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/lib/spotbugs/entity/bug_instance.rb +15 -7
- data/lib/spotbugs/gem_version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8813e879ca3e2f0574b73b106872369a3b341d46e1b08ec7ac0ee9c89b8ff73d
|
4
|
+
data.tar.gz: b4b6566b2234e34cca5950cae9a8dada5398a7f4ef3627abe9871ac611f6f3bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 195edf7c7eaaed5c3efefe7327b8c453ccbc7a3e78dce6b52986d52a8f83c40a259ce38cc71d68af358b4e139e992abd85d29724231105d2b4b7fc35ea5d7e17
|
7
|
+
data.tar.gz: f849b2ae5af1fb6bb44395a0b9cd773df30f47d74bea2288c00fa2eadf0d01487e1a7fe6eefcd8b9bbfbef78dceb5c42feda8ee914497a051234d82085c3cd56
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-spotbugs (0.0.
|
4
|
+
danger-spotbugs (0.0.3)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
6
|
oga (~> 2.15)
|
7
7
|
|
@@ -40,13 +40,17 @@ GEM
|
|
40
40
|
danger (> 2.0)
|
41
41
|
diff-lcs (1.4.4)
|
42
42
|
docile (1.3.5)
|
43
|
-
faraday (1.
|
43
|
+
faraday (1.4.1)
|
44
|
+
faraday-excon (~> 1.1)
|
44
45
|
faraday-net_http (~> 1.0)
|
46
|
+
faraday-net_http_persistent (~> 1.1)
|
45
47
|
multipart-post (>= 1.2, < 3)
|
46
|
-
ruby2_keywords
|
48
|
+
ruby2_keywords (>= 0.0.4)
|
49
|
+
faraday-excon (1.1.0)
|
47
50
|
faraday-http-cache (2.2.0)
|
48
51
|
faraday (>= 0.8)
|
49
52
|
faraday-net_http (1.0.1)
|
53
|
+
faraday-net_http_persistent (1.1.0)
|
50
54
|
ffi (1.15.0)
|
51
55
|
formatador (0.2.5)
|
52
56
|
git (1.8.1)
|
@@ -81,7 +85,7 @@ GEM
|
|
81
85
|
notiffany (0.1.3)
|
82
86
|
nenv (~> 0.1)
|
83
87
|
shellany (~> 0.0)
|
84
|
-
octokit (4.
|
88
|
+
octokit (4.21.0)
|
85
89
|
faraday (>= 0.9)
|
86
90
|
sawyer (~> 0.8.0, >= 0.5.3)
|
87
91
|
oga (2.15)
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Danger SpotBugs
|
2
|
-
[](https://github.com/mathroule/danger-spotbugs/releases/latest) [](https://github.com/mathroule/danger-spotbugs/actions) [](https://codecov.io/gh/mathroule/danger-spotbugs)
|
2
|
+
[](https://github.com/mathroule/danger-spotbugs/releases/latest) [](https://opensource.org/licenses/MIT) [](https://github.com/mathroule/danger-spotbugs/actions) [](https://codecov.io/gh/mathroule/danger-spotbugs)
|
3
3
|
|
4
4
|
Checks on your Gradle project's Java source files.
|
5
5
|
This is done using [SpotBugs](https://spotbugs.github.io)
|
@@ -10,15 +10,11 @@ class BugInstance
|
|
10
10
|
@source_dirs = source_dirs
|
11
11
|
@bug_instance = bug_instance
|
12
12
|
|
13
|
-
source_path = bug_instance
|
13
|
+
source_path = get_source_path(bug_instance)
|
14
14
|
@absolute_path = get_absolute_path(source_path)
|
15
15
|
|
16
16
|
prefix += (prefix.end_with?(file_separator) ? '' : file_separator)
|
17
|
-
@relative_path =
|
18
|
-
@absolute_path[prefix.length, @absolute_path.length - prefix.length]
|
19
|
-
else
|
20
|
-
@absolute_path
|
21
|
-
end
|
17
|
+
@relative_path = get_relative_path(prefix, @absolute_path)
|
22
18
|
end
|
23
19
|
|
24
20
|
def rank
|
@@ -30,7 +26,7 @@ class BugInstance
|
|
30
26
|
end
|
31
27
|
|
32
28
|
def line
|
33
|
-
@line ||= bug_instance.xpath('SourceLine').attribute('start').first.value.to_i
|
29
|
+
@line ||= bug_instance.xpath('SourceLine').attribute('start').compact.first.value.to_i
|
34
30
|
end
|
35
31
|
|
36
32
|
def description
|
@@ -39,12 +35,24 @@ class BugInstance
|
|
39
35
|
|
40
36
|
private
|
41
37
|
|
38
|
+
def get_source_path(bug_instance)
|
39
|
+
bug_instance.xpath('SourceLine').attribute('sourcepath').compact.first.value.to_s
|
40
|
+
end
|
41
|
+
|
42
42
|
def get_absolute_path(source_path)
|
43
43
|
@source_dirs.map do |source_dir|
|
44
44
|
return source_dir if source_dir.end_with?(source_path)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
+
def get_relative_path(prefix, absolute_path)
|
49
|
+
if absolute_path.start_with?(prefix)
|
50
|
+
absolute_path[prefix.length, absolute_path.length - prefix.length]
|
51
|
+
else
|
52
|
+
absolute_path
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
48
56
|
def file_separator
|
49
57
|
File::ALT_SEPARATOR || File::SEPARATOR
|
50
58
|
end
|
data/lib/spotbugs/gem_version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-spotbugs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathieu Rul
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
253
253
|
- !ruby/object:Gem::Version
|
254
254
|
version: '0'
|
255
255
|
requirements: []
|
256
|
-
rubygems_version: 3.2.
|
256
|
+
rubygems_version: 3.2.15
|
257
257
|
signing_key:
|
258
258
|
specification_version: 4
|
259
259
|
summary: A Danger plugin for SpotBugs, see https://spotbugs.github.io.
|