danger-pmd 0.4.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: 1b43b0fc15896bd97ff42ba4c4fed6845f8953fd69984258bd81341864f52692
4
- data.tar.gz: dd44a47f44c0b6ecaf6179e9fca3c42d61e9438a11b578a644653e29af82921a
3
+ metadata.gz: 4cc9fb89231f4e208ace7fecad1dc8efc13a5cbc762a044ce10e280cfa8bf4cf
4
+ data.tar.gz: e7aa70238501b80d9106bb088ae8da08f816fdf7f0f21f13e64ac1a37f667686
5
5
  SHA512:
6
- metadata.gz: 4d9cb1e5c13c0b34f6710c0a149c0a7c389285f05c33b2bc2b711ea978ea366526e60f8856fc43be2babc4ed97eb1dc33c1c2da53ef7985649ba5ba4e1fc01bd
7
- data.tar.gz: 37150cf848d13b6eb2d4bbce61ef6236bc4f5b6a1b94f0f74dfd344143305bb5aec6d6783a4ea532bf112e19621efcc947034b90a268a6d096c166a4d7dc84df
6
+ metadata.gz: dacdaeac8a0bbcdc9776876c3ddb6aca4e7124771de19389ed2a3b242fbfa451461190777350195ea6c77ffa51cc6e0a781387fb086b925ee0c49d1180a3875b
7
+ data.tar.gz: b3c230a67ea00f6bef06997204e142f6a5dbcb36a50b9ae814183e479bb736eb27e3e85bcf6d8ff9e748fb9b2d6d6637171edb9fa4874a4ea3eb90572002437a
@@ -0,0 +1,35 @@
1
+ name: Publish
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ branches: [ main ]
6
+
7
+ jobs:
8
+ test:
9
+ name: Publish gem
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - name: Set up Ruby
14
+ uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: '2.6'
17
+ bundler-cache: true
18
+ - name: Run tests
19
+ run: bundle exec rake spec
20
+ - name: Publish gem
21
+ uses: dawidd6/action-publish-gem@v1
22
+ with:
23
+ api_key: ${{secrets.RUBYGEMS_API_KEY}}
24
+ - name: Create git tag
25
+ uses: duderman/gh-gem-tag-action@v1
26
+ id: release_info
27
+ with:
28
+ github_token: ${{ secrets.GITHUB_TOKEN }}
29
+ - uses: xresloader/upload-to-github-release@v1
30
+ env:
31
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
+ with:
33
+ tag_name: ${{ steps.release_info.outputs.tag }}
34
+ draft: false
35
+ file: '*.gem'
@@ -0,0 +1,21 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Set up Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: '2.6'
19
+ bundler-cache: true
20
+ - name: Run tests
21
+ run: bundle exec rake spec
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@
3
3
  # If you don't like these settings, just delete this file :)
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 2.3
6
+ TargetRubyVersion: 2.4
7
7
 
8
8
  Style/StringLiterals:
9
9
  EnforcedStyle: double_quotes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-pmd (0.4.0)
4
+ danger-pmd (1.0.1)
5
5
  danger-plugin-api (~> 1.0)
6
6
  oga (~> 2.10)
7
7
 
@@ -21,15 +21,15 @@ GEM
21
21
  colored2 (3.1.2)
22
22
  cork (0.3.0)
23
23
  colored2 (~> 3.1)
24
- danger (6.1.0)
24
+ danger (8.2.2)
25
25
  claide (~> 1.0)
26
26
  claide-plugins (>= 0.9.2)
27
27
  colored2 (~> 3.1)
28
28
  cork (~> 0.1)
29
- faraday (~> 0.9)
29
+ faraday (>= 0.9.0, < 2.0)
30
30
  faraday-http-cache (~> 2.0)
31
- git (~> 1.5)
32
- kramdown (~> 2.0)
31
+ git (~> 1.7)
32
+ kramdown (~> 2.3)
33
33
  kramdown-parser-gfm (~> 1.0)
34
34
  no_proxy_fix
35
35
  octokit (~> 4.7)
@@ -37,13 +37,17 @@ GEM
37
37
  danger-plugin-api (1.0.0)
38
38
  danger (> 2.0)
39
39
  diff-lcs (1.3)
40
- faraday (0.17.3)
40
+ faraday (1.3.0)
41
+ faraday-net_http (~> 1.0)
41
42
  multipart-post (>= 1.2, < 3)
42
- faraday-http-cache (2.0.0)
43
- faraday (~> 0.8)
43
+ ruby2_keywords
44
+ faraday-http-cache (2.2.0)
45
+ faraday (>= 0.8)
46
+ faraday-net_http (1.0.1)
44
47
  ffi (1.11.3)
45
48
  formatador (0.2.5)
46
- git (1.5.0)
49
+ git (1.8.1)
50
+ rchardet (~> 1.8)
47
51
  guard (2.16.1)
48
52
  formatador (>= 0.2.4)
49
53
  listen (>= 2.7, < 4.0)
@@ -59,7 +63,8 @@ GEM
59
63
  guard-compat (~> 1.1)
60
64
  rspec (>= 2.99.0, < 4.0)
61
65
  jaro_winkler (1.5.4)
62
- kramdown (2.1.0)
66
+ kramdown (2.3.0)
67
+ rexml
63
68
  kramdown-parser-gfm (1.1.0)
64
69
  kramdown (~> 2.0)
65
70
  listen (3.0.7)
@@ -74,7 +79,7 @@ GEM
74
79
  notiffany (0.1.3)
75
80
  nenv (~> 0.1)
76
81
  shellany (~> 0.0)
77
- octokit (4.15.0)
82
+ octokit (4.20.0)
78
83
  faraday (>= 0.9)
79
84
  sawyer (~> 0.8.0, >= 0.5.3)
80
85
  oga (2.15)
@@ -87,12 +92,14 @@ GEM
87
92
  pry (0.12.2)
88
93
  coderay (~> 1.1.0)
89
94
  method_source (~> 0.9.0)
90
- public_suffix (4.0.3)
95
+ public_suffix (4.0.6)
91
96
  rainbow (3.0.0)
92
- rake (10.5.0)
97
+ rake (13.0.1)
93
98
  rb-fsevent (0.10.3)
94
99
  rb-inotify (0.10.1)
95
100
  ffi (~> 1.0)
101
+ rchardet (1.8.0)
102
+ rexml (3.2.4)
96
103
  rspec (3.9.0)
97
104
  rspec-core (~> 3.9.0)
98
105
  rspec-expectations (~> 3.9.0)
@@ -117,6 +124,7 @@ GEM
117
124
  ansi
118
125
  ast
119
126
  ruby-progressbar (1.10.1)
127
+ ruby2_keywords (0.0.4)
120
128
  sawyer (0.8.2)
121
129
  addressable (>= 2.3.5)
122
130
  faraday (> 0.8, < 2.0)
@@ -137,10 +145,10 @@ DEPENDENCIES
137
145
  guard-rspec (~> 4.7)
138
146
  listen (= 3.0.7)
139
147
  pry
140
- rake (~> 10.0)
148
+ rake (~> 13.0)
141
149
  rspec (~> 3.4)
142
150
  rubocop (~> 0.75)
143
151
  yard (~> 0.9.20)
144
152
 
145
153
  BUNDLED WITH
146
- 1.17.3
154
+ 2.2.14
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Mathieu Rul <mathroule@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Danger PMD
2
2
 
3
- Danger plugin for PMD formatted xml file. This plugin is inspired from https://github.com/kazy1991/danger-findbugs.
3
+ Checks on your Gradle project's Java source files.
4
+ This is done using [PMD](https://pmd.github.io)
5
+ Results are passed out as tables in markdown.
6
+
7
+ This plugin is inspired from https://github.com/kazy1991/danger-findbugs.
4
8
 
5
9
  ## Installation
6
10
 
@@ -12,31 +16,38 @@ Danger plugin for PMD formatted xml file. This plugin is inspired from https://g
12
16
  your `Dangerfile` under the `pmd` namespace.
13
17
 
14
18
  <blockquote>Running PMD with its basic configuration
15
- <pre>
19
+ <pre>
20
+ pmd.report
21
+ </pre>
22
+ </blockquote>
23
+
24
+ <blockquote>Running PMD with a specific Gradle task or report file (glob accepted)
25
+ <pre>
26
+ pmd.gradle_task = 'app:pmd' # default: pmd
27
+ pmd.report_file = 'module/build/reports/pmd/pmd.xml' # default: app/build/reports/pmd/pmd.xml
16
28
  pmd.report
17
- </pre>
29
+ </pre>
18
30
  </blockquote>
19
31
 
20
- <blockquote>Running PMD with a specific Gradle task or report file
21
- <pre>
22
- pmd.gradle_task = 'app:pmd' #defalut: pmd
23
- pmd.report_file = "app/build/reports/pmd/pmd.xml"
32
+ <blockquote>Running PMD with a specific root path
33
+ <pre>
34
+ pmd.root_path = '/Users/developer/project'
24
35
  pmd.report
25
- </pre>
36
+ </pre>
26
37
  </blockquote>
27
38
 
28
- <blockquote>Running PMD with an array of report files
29
- <pre>
30
- pmd.report_files = ["modules/**/build/reports/pmd/pmd.xml", "app/build/reports/pmd/pmd.xml"]
39
+ <blockquote>Running PMD with an array of report files (glob accepted)
40
+ <pre>
41
+ pmd.report_files = ['modules/**/build/reports/pmd/pmd.xml', 'app/build/reports/pmd/pmd.xml']
31
42
  pmd.report
32
- </pre>
43
+ </pre>
33
44
  </blockquote>
34
45
 
35
46
  <blockquote>Running PMD without running a Gradle task
36
- <pre>
47
+ <pre>
37
48
  pmd.skip_gradle_task = true
38
49
  pmd.report
39
- </pre>
50
+ </pre>
40
51
  </blockquote>
41
52
 
42
53
  #### Attributes
@@ -47,24 +58,26 @@ Defaults to "pmd".
47
58
 
48
59
  `skip_gradle_task` - Skip Gradle task.
49
60
  If you skip Gradle task, for example project does not manage Gradle.
61
+ Defaults to `false`.
50
62
 
51
- `root_path` - Location of the project root
52
- If your project root is different from git's top-level path.
63
+ `root_path` - An absolute path to a root.
64
+ To comment errors to VCS, this needs to know relative path of files from the root.
53
65
  Defaults to result of "git rev-parse --show-toplevel".
54
66
 
55
- `report_file` - Location of report file
67
+ `report_file` - Location of report file.
56
68
  If your pmd task outputs to a different location, you can specify it here.
57
69
  Defaults to "app/build/reports/pmd/pmd.xml".
58
70
 
59
- `report_files` - Location of report files
71
+ `report_files` - Location of report files.
60
72
  If your pmd task outputs to a different location, you can specify it here.
61
- Defaults to ["app/build/reports/pmd/pmd.xml]".
73
+ Defaults to ['app/build/reports/pmd/pmd.xml'].
62
74
 
63
75
  #### Methods
64
76
 
65
- `report` - Calls PMD task of your Gradle project, send comment and return PMD issues.
77
+ `report` - Calls PMD task of your Gradle project.
66
78
  It fails if `gradlew` cannot be found inside current directory.
67
- It fails if `report_file` or `report_files` cannot be found inside current directory.
79
+ It fails if `report_file` cannot be found inside current directory.
80
+ It fails if `report_files` is empty.
68
81
 
69
82
  `gradle_task` - A getter for `gradle_task`, returning Gradle task report.
70
83
 
data/danger-pmd.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  # General ruby development
25
25
  spec.add_development_dependency 'bundler', '~> 1.3'
26
- spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rake', '~> 13.0'
27
27
 
28
28
  # Testing support
29
29
  spec.add_development_dependency 'rspec', '~> 3.4'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pmd
4
- VERSION = "0.4.0"
4
+ VERSION = "1.0.1"
5
5
  end
data/lib/pmd/plugin.rb CHANGED
@@ -11,18 +11,18 @@ module Danger
11
11
  #
12
12
  # @example Running PMD with a specific Gradle task or report file (glob accepted)
13
13
  #
14
- # pmd.gradle_task = 'app:pmd' #defalut: pmd
15
- # pmd.report_file = "module/build/reports/pmd/pmd.xml" #defalut: app/build/reports/pmd/pmd.xml
14
+ # pmd.gradle_task = 'app:pmd' # default: pmd
15
+ # pmd.report_file = 'module/build/reports/pmd/pmd.xml' # default: app/build/reports/pmd/pmd.xml
16
16
  # pmd.report
17
17
  #
18
18
  # @example Running PMD with a specific root path
19
19
  #
20
- # pmd.root_path = '/Users/developer/project
20
+ # pmd.root_path = '/Users/developer/project'
21
21
  # pmd.report
22
22
  #
23
23
  # @example Running PMD with an array of report files (glob accepted)
24
24
  #
25
- # pmd.report_files = ["modules/**/build/reports/pmd/pmd.xml", "app/build/reports/pmd/pmd.xml"]
25
+ # pmd.report_files = ['modules/**/build/reports/pmd/pmd.xml', 'app/build/reports/pmd/pmd.xml']
26
26
  # pmd.report
27
27
  #
28
28
  # @example Running PMD without running a Gradle task
@@ -32,7 +32,6 @@ module Danger
32
32
  #
33
33
  # @see mathroule/danger-pmd
34
34
  # @tags java, android, pmd
35
-
36
35
  class DangerPmd < Plugin
37
36
  require_relative "./entity/pmd_file"
38
37
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-pmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathieu Rul
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-08 00:00:00.000000000 Z
11
+ date: 2021-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -171,13 +171,14 @@ executables: []
171
171
  extensions: []
172
172
  extra_rdoc_files: []
173
173
  files:
174
+ - ".github/workflows/publish.yml"
175
+ - ".github/workflows/test.yml"
174
176
  - ".gitignore"
175
177
  - ".rubocop.yml"
176
- - ".travis.yml"
177
178
  - Gemfile
178
179
  - Gemfile.lock
179
180
  - Guardfile
180
- - LICENSE.txt
181
+ - LICENSE
181
182
  - README.md
182
183
  - Rakefile
183
184
  - danger-pmd.gemspec
@@ -212,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
213
  - !ruby/object:Gem::Version
213
214
  version: '0'
214
215
  requirements: []
215
- rubygems_version: 3.0.6
216
+ rubygems_version: 3.0.3
216
217
  signing_key:
217
218
  specification_version: 4
218
219
  summary: A Danger plugin for PMD (Programming Mistake Detector), see https://pmd.github.io.
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- language: ruby
2
- cache:
3
- directories:
4
- - bundle
5
-
6
- rvm:
7
- - 2.3.8
8
-
9
- script:
10
- - bundle exec rake spec
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2019 Mathieu Rul <mathroule@gmail.com>
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.