pmdtester 1.6.1 → 1.7.0

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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +12 -0
  3. data/.github/workflows/build.yml +9 -7
  4. data/.github/workflows/manual-integration-tests.yml +9 -7
  5. data/.github/workflows/publish-release.yml +9 -9
  6. data/.hoerc +1 -1
  7. data/.rubocop_todo.yml +1 -14
  8. data/.vscode/launch.json +32 -0
  9. data/History.md +54 -0
  10. data/Manifest.txt +13 -0
  11. data/README.rdoc +77 -30
  12. data/Rakefile +11 -11
  13. data/config/custom.jfc +1126 -0
  14. data/config/project-list-with-cpd.xml +268 -0
  15. data/config/projectlist_1_2_0.xsd +1 -1
  16. data/config/projectlist_1_3_0.xsd +53 -0
  17. data/lib/pmdtester/builders/cpd_project_hasher.rb +70 -0
  18. data/lib/pmdtester/builders/liquid_renderer.rb +111 -16
  19. data/lib/pmdtester/builders/pmd_report_builder.rb +139 -41
  20. data/lib/pmdtester/builders/project_hasher.rb +24 -25
  21. data/lib/pmdtester/builders/rule_set_builder.rb +43 -11
  22. data/lib/pmdtester/builders/summary_report_builder.rb +6 -1
  23. data/lib/pmdtester/cmd.rb +24 -9
  24. data/lib/pmdtester/cpd_report_diff.rb +99 -0
  25. data/lib/pmdtester/jfr_summary.rb +119 -0
  26. data/lib/pmdtester/location.rb +38 -0
  27. data/lib/pmdtester/parsers/cpd_report_document.rb +241 -0
  28. data/lib/pmdtester/parsers/options.rb +19 -0
  29. data/lib/pmdtester/parsers/pmd_report_document.rb +14 -1
  30. data/lib/pmdtester/parsers/projects_parser.rb +1 -1
  31. data/lib/pmdtester/pmd_branch_detail.rb +29 -9
  32. data/lib/pmdtester/pmd_report_detail.rb +54 -13
  33. data/lib/pmdtester/pmd_tester_utils.rb +45 -17
  34. data/lib/pmdtester/pmd_violation.rb +15 -6
  35. data/lib/pmdtester/project.rb +63 -3
  36. data/lib/pmdtester/report_diff.rb +5 -13
  37. data/lib/pmdtester/runner.rb +185 -37
  38. data/lib/pmdtester/system_info.rb +58 -0
  39. data/lib/pmdtester/word_differ.rb +132 -0
  40. data/lib/pmdtester.rb +8 -1
  41. data/pmdtester.gemspec +17 -17
  42. data/resources/css/pmd-tester.css +15 -0
  43. data/resources/js/project-report.js +293 -112
  44. data/resources/project_cpd_report.html +144 -0
  45. data/resources/project_diff_report.html +151 -18
  46. data/resources/project_index.html +12 -3
  47. data/resources/project_pmd_report.html +17 -2
  48. metadata +63 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7429c569bdac259cad6b5f768efeea761f09526feccae27fcb3ff25a8dc11da6
4
- data.tar.gz: f721bec1256b72ac94d81a06155be85724d2ecb27ddc4228ded4ffb4e23d85f2
3
+ metadata.gz: 71ed64943a53756dc77fb504aac4b960517f104496beffe7c54b0ee2bfb0f3ca
4
+ data.tar.gz: 860cef2f384b0b9eb388d7b8c98cad42f0b2961ee8a4a7bb5b81cb91d4cd1189
5
5
  SHA512:
6
- metadata.gz: 896eaf9c9979252c7fb326c4f80aa009db10dff63393f20482c48397c9efdacdd911faef516c2be198559fce9428776ec0728a1f8d6cc9f7f3d91803d1034f4c
7
- data.tar.gz: ae4143fa783d36093c8d0e1927732de4aa62d5e91563f04067dce22710f408a11e59e61e6e7ba14dfd35250b8ca85dc7a0007caed69807abd96fff011f981928
6
+ metadata.gz: 06c5079fb2b9d8e1fe011563a3baf2008f9ebd62eb8b9a312ec413346ab2356f9b9f625f95266491c2dd15fb58552c0b608c0b8e25c91cb9f3cacda281835e1c
7
+ data.tar.gz: 16720c87b6cc5d3ffac153571ae518ffb6ff81ef405bd3adb4ad8d3cfbc7dfa9ebbaafa19a0b678c6c5e22e06daef2fcdacb3658c7c7ca8a21abd5f874bff61b
@@ -0,0 +1,12 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "github-actions" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
12
+ day: "wednesday"
@@ -23,14 +23,16 @@ jobs:
23
23
  run:
24
24
  shell: bash
25
25
  steps:
26
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
27
- - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 #v4.7.1
26
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
27
+ - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 #v5.2.0
28
28
  with:
29
29
  distribution: 'temurin'
30
- java-version: '11'
30
+ java-version: |
31
+ 11
32
+ 21
31
33
  - name: Prepare HOME/openjdk11
32
34
  run: ln -sfn "${JAVA_HOME_11_X64}" "${HOME}/openjdk11"
33
- - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 #v4.2.4
35
+ - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae #v5.0.5
34
36
  with:
35
37
  path: |
36
38
  ~/.m2/repository
@@ -41,10 +43,10 @@ jobs:
41
43
  key: v4-${{ runner.os }}-${{ hashFiles('pmdtester.gemspec') }}
42
44
  restore-keys: |
43
45
  v4-${{ runner.os }}-
44
- - name: Set up Ruby 3.3
45
- uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 #v1.254.0
46
+ - name: Set up Ruby 4
47
+ uses: ruby/setup-ruby@4c56a21280b36d862b5fc31348f463d60bdc55d5 #v1.301.0
46
48
  with:
47
- ruby-version: 3.3
49
+ ruby-version: 4
48
50
  - name: Install dependencies (bundler)
49
51
  run: |
50
52
  # bundler should already be installed
@@ -18,14 +18,16 @@ jobs:
18
18
  runs-on: ubuntu-latest
19
19
  continue-on-error: false
20
20
  steps:
21
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
22
- - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 #v4.7.1
21
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
22
+ - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 #v5.2.0
23
23
  with:
24
24
  distribution: 'temurin'
25
- java-version: '11'
25
+ java-version: |
26
+ 11
27
+ 21
26
28
  - name: Prepare HOME/openjdk11
27
29
  run: ln -sfn "${JAVA_HOME_11_X64}" "${HOME}/openjdk11"
28
- - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 #v4.2.4
30
+ - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae #v5.0.5
29
31
  with:
30
32
  path: |
31
33
  ~/.m2/repository
@@ -36,10 +38,10 @@ jobs:
36
38
  key: v4-${{ runner.os }}-${{ hashFiles('pmdtester.gemspec') }}
37
39
  restore-keys: |
38
40
  v4-${{ runner.os }}-
39
- - name: Set up Ruby 3.3
40
- uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 #v1.254.0
41
+ - name: Set up Ruby 4
42
+ uses: ruby/setup-ruby@4c56a21280b36d862b5fc31348f463d60bdc55d5 #v1.301.0
41
43
  with:
42
- ruby-version: 3.3
44
+ ruby-version: 4
43
45
  - name: Install dependencies (bundler)
44
46
  run: |
45
47
  # bundler should already be installed
@@ -30,13 +30,13 @@ jobs:
30
30
  outputs:
31
31
  VERSION: ${{ steps.version.outputs.VERSION }}
32
32
  steps:
33
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
33
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
34
34
  with:
35
35
  ref: ${{ github.event.workflow_run.head_branch }}
36
- - name: Set up Ruby 3.3
37
- uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 #v1.254.0
36
+ - name: Set up Ruby 4
37
+ uses: ruby/setup-ruby@4c56a21280b36d862b5fc31348f463d60bdc55d5 #v1.301.0
38
38
  with:
39
- ruby-version: 3.3
39
+ ruby-version: 4
40
40
  - name: Install dependencies (bundler)
41
41
  run: |
42
42
  # bundler should already be installed
@@ -91,13 +91,13 @@ jobs:
91
91
  run:
92
92
  shell: bash
93
93
  steps:
94
- - uses: actions/checkout@v4
94
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
95
95
  with:
96
96
  ref: ${{ github.event.workflow_run.head_branch }}
97
- - name: Set up Ruby 3.3
98
- uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 #v1.254.0
97
+ - name: Set up Ruby 4
98
+ uses: ruby/setup-ruby@4c56a21280b36d862b5fc31348f463d60bdc55d5 #v1.301.0
99
99
  with:
100
- ruby-version: 3.3
100
+ ruby-version: 4
101
101
  - name: Install dependencies (bundler)
102
102
  run: |
103
103
  # bundler should already be installed
@@ -119,7 +119,7 @@ jobs:
119
119
  gem build pmdtester.gemspec
120
120
  gempkgfile="$(echo pmdtester-*.gem)"
121
121
  gem push "${gempkgfile}"
122
- - uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e #v2.0.6
122
+ - uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1
123
123
  id: pmd-actions-helper-app-token
124
124
  with:
125
125
  app-id: ${{ secrets.PMD_ACTIONS_HELPER_ID }}
data/.hoerc CHANGED
@@ -1 +1 @@
1
- exclude: !ruby/regexp /tmp$|\.git\/|\.idea|\.project|target\/|test\/|Gemfile\.lock|\.bundle\/|vendor\/|localtests\/|\.ci\/inc\/(log|utils|setup-secrets|openjdk|github-releases-api)\.bash|\.ci\/files\/|\.ci\/check-environment\.sh/
1
+ exclude: !ruby/regexp /tmp$|\.git\/|\.idea|\.project|target\/|test\/|Gemfile\.lock|\.bundle\/|vendor\/|localtests\/|\.ci\/inc\/(log|utils|setup-secrets|openjdk|github-releases-api)\.bash|\.ci\/files\/|\.ci\/check-environment\.sh|\.ruby-lsp\//
data/.rubocop_todo.yml CHANGED
@@ -6,12 +6,11 @@
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 3
9
+ # Offense count: 2
10
10
  # Configuration parameters: AllowedParentClasses.
11
11
  Lint/MissingSuper:
12
12
  Exclude:
13
13
  - 'lib/pmdtester/cmd.rb'
14
- - 'lib/pmdtester/parsers/pmd_report_document.rb'
15
14
  - 'lib/pmdtester/parsers/projects_parser.rb'
16
15
 
17
16
  # Offense count: 47
@@ -24,11 +23,6 @@ Metrics/AbcSize:
24
23
  Metrics/MethodLength:
25
24
  Max: 22
26
25
 
27
- # Offense count: 3
28
- Naming/AccessorMethodName:
29
- Exclude:
30
- - 'lib/pmdtester/builders/pmd_report_builder.rb'
31
-
32
26
  # Offense count: 2
33
27
  # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
34
28
  # SupportedStyles: snake_case, normalcase, non_integer
@@ -57,7 +51,6 @@ Style/AccessorGrouping:
57
51
  # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE
58
52
  Style/CommentAnnotation:
59
53
  Exclude:
60
- - 'lib/pmdtester/builders/pmd_report_builder.rb'
61
54
  - 'lib/pmdtester/builders/project_builder.rb'
62
55
  - 'test/test_pmd_report_document.rb'
63
56
 
@@ -80,9 +73,3 @@ Style/HashEachMethods:
80
73
  Style/KeywordParametersOrder:
81
74
  Exclude:
82
75
  - 'lib/pmdtester/pmd_report_detail.rb'
83
-
84
- # Offense count: 1
85
- # This cop supports safe autocorrection (--autocorrect).
86
- Style/RedundantAssignment:
87
- Exclude:
88
- - 'lib/pmdtester/builders/pmd_report_builder.rb'
@@ -0,0 +1,32 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+
8
+ {
9
+ "type": "ruby_lsp",
10
+ "name": "Debug script",
11
+ "request": "launch",
12
+ "program": "ruby ${file}"
13
+ },
14
+ {
15
+ "type": "ruby_lsp",
16
+ "name": "Debug test",
17
+ "request": "launch",
18
+ "program": "ruby -Itest ${relativeFile}"
19
+ },
20
+ {
21
+ "type": "ruby_lsp",
22
+ "name": "Attach debugger",
23
+ "request": "attach"
24
+ },
25
+ {
26
+ "type": "ruby_lsp",
27
+ "name": "Attach debugger to socket",
28
+ "request": "attach",
29
+ "debugSocketPath": "/run/user/1000/rdbg-240259"
30
+ }
31
+ ]
32
+ }
data/History.md CHANGED
@@ -1,3 +1,57 @@
1
+ # 1.7.0 / 2026-04-16
2
+ ## New and Noteworthy
3
+ ### Required Ruby version
4
+
5
+ With this version, Ruby 4 or higher is required.
6
+
7
+ ## Enhancements
8
+ * [#145](https://github.com/pmd/pmd-regression-tester/issues/145): Add support for CPD regression testing
9
+ * [#146](https://github.com/pmd/pmd-regression-tester/issues/146): Add support for measuring CPU and Memory usage
10
+ * [#148](https://github.com/pmd/pmd-regression-tester/issues/148): Add support for comparing entire rule violation location
11
+ * [#168](https://github.com/pmd/pmd-regression-tester/pull/168): Update to ruby 4
12
+ ## Fixed Issues
13
+ * [#144](https://github.com/pmd/pmd-regression-tester/issues/144): Deprecated usage liquid Template.file_system
14
+ ## Merged pull requests
15
+ * [#147](https://github.com/pmd/pmd-regression-tester/pull/147): chore: Fix manual integration tests - [Andreas Dangel](https://github.com/adangel) (@adangel)
16
+ * [#149](https://github.com/pmd/pmd-regression-tester/pull/149): Fix #148: Add support for comparing entire rule violation location - [Andreas Dangel](https://github.com/adangel) (@adangel)
17
+ * [#150](https://github.com/pmd/pmd-regression-tester/pull/150): chore: Use java 21 as default - [Andreas Dangel](https://github.com/adangel) (@adangel)
18
+ * [#151](https://github.com/pmd/pmd-regression-tester/pull/151): chore: fix deprecations - [Andreas Dangel](https://github.com/adangel) (@adangel)
19
+ * [#152](https://github.com/pmd/pmd-regression-tester/pull/152): chore: enable dependabot - [Andreas Dangel](https://github.com/adangel) (@adangel)
20
+ * [#162](https://github.com/pmd/pmd-regression-tester/pull/162): chore: Add debugging information - [Andreas Dangel](https://github.com/adangel) (@adangel)
21
+ * [#169](https://github.com/pmd/pmd-regression-tester/pull/169): Add support for CPD regression testing - [Andreas Dangel](https://github.com/adangel) (@adangel)
22
+ * [#170](https://github.com/pmd/pmd-regression-tester/pull/170): chore: Fix rubocop Style/FileOpen issues - [Andreas Dangel](https://github.com/adangel) (@adangel)
23
+ * [#171](https://github.com/pmd/pmd-regression-tester/pull/171): Add support for measuring CPU and Memory usage - [Andreas Dangel](https://github.com/adangel) (@adangel)
24
+ ## Dependency Updates
25
+ * [#153](https://github.com/pmd/pmd-regression-tester/pull/153): chore: Bump nokogiri from 1.18 to 1.19
26
+ * [#154](https://github.com/pmd/pmd-regression-tester/pull/154): chore: Bump logger-colors from 1.0 to 1.1
27
+ * [#155](https://github.com/pmd/pmd-regression-tester/pull/155): chore: Bump liquid from 5.8 to 5.11
28
+ * [#156](https://github.com/pmd/pmd-regression-tester/pull/156): chore: Bump bigdecimal from 3.2 to 4.0
29
+ * [#157](https://github.com/pmd/pmd-regression-tester/pull/157): chore: Bump minitest from 5.25 to 6.0
30
+ * [#158](https://github.com/pmd/pmd-regression-tester/pull/158): chore: Bump mocha from 2.7 to 3.0
31
+ * [#159](https://github.com/pmd/pmd-regression-tester/pull/159): chore: Bump rubocop from 1.79 to 1.84
32
+ * [#160](https://github.com/pmd/pmd-regression-tester/pull/160): chore: Bump rdoc from 6.12 to 7.2
33
+ * [#161](https://github.com/pmd/pmd-regression-tester/pull/161): chore: Bump hoe from 4.2 to 4.6
34
+ * [#163](https://github.com/pmd/pmd-regression-tester/pull/163): Bump actions/cache from 4.2.4 to 5.0.3
35
+ * [#164](https://github.com/pmd/pmd-regression-tester/pull/164): Bump actions/setup-java from 4.7.1 to 5.2.0
36
+ * [#165](https://github.com/pmd/pmd-regression-tester/pull/165): Bump actions/checkout from 4 to 6
37
+ * [#166](https://github.com/pmd/pmd-regression-tester/pull/166): Bump ruby/setup-ruby from 1.254.0 to 1.288.0
38
+ * [#167](https://github.com/pmd/pmd-regression-tester/pull/167): Bump actions/create-github-app-token from 2.0.6 to 2.2.1
39
+ * [#172](https://github.com/pmd/pmd-regression-tester/pull/172): Bump ruby/setup-ruby from 1.288.0 to 1.292.0
40
+ * [#173](https://github.com/pmd/pmd-regression-tester/pull/173): Bump actions/create-github-app-token from 2.2.1 to 3.0.0
41
+ * [#174](https://github.com/pmd/pmd-regression-tester/pull/174): Bump actions/cache from 5.0.3 to 5.0.4
42
+ * [#175](https://github.com/pmd/pmd-regression-tester/pull/175): Bump ruby/setup-ruby from 1.292.0 to 1.295.0
43
+ * [#177](https://github.com/pmd/pmd-regression-tester/pull/177): Bump ruby/setup-ruby from 1.295.0 to 1.300.0
44
+ * [#178](https://github.com/pmd/pmd-regression-tester/pull/178): Bump actions/create-github-app-token from 3.0.0 to 3.1.1
45
+ * [#179](https://github.com/pmd/pmd-regression-tester/pull/179): Bump ruby/setup-ruby from 1.300.0 to 1.301.0
46
+ * [#180](https://github.com/pmd/pmd-regression-tester/pull/180): Bump actions/cache from 5.0.4 to 5.0.5
47
+
48
+ # 1.6.2 / 2025-10-24
49
+ ## Fixed Issues
50
+ * [#142](https://github.com/pmd/pmd-regression-tester/pull/142): Support `--auto-gen-config` for rules which start with "Abstract"
51
+ ## Merged pull requests
52
+ * [#142](https://github.com/pmd/pmd-regression-tester/pull/142): Support `--auto-gen-config` for rules which start with "Abstract" - [Andreas Dangel](https://github.com/adangel) (@adangel)
53
+ * [#143](https://github.com/pmd/pmd-regression-tester/pull/143): chore(ci): Use java 17 as default - [Andreas Dangel](https://github.com/adangel) (@adangel)
54
+
1
55
  # 1.6.1 / 2025-09-19
2
56
 
3
57
  ## Fixed Issues
data/Manifest.txt CHANGED
@@ -1,3 +1,4 @@
1
+ .github/dependabot.yml
1
2
  .github/workflows/build-pr.yml
2
3
  .github/workflows/build-release.yml
3
4
  .github/workflows/build-snapshot.yml
@@ -8,6 +9,7 @@
8
9
  .hoerc
9
10
  .rubocop.yml
10
11
  .rubocop_todo.yml
12
+ .vscode/launch.json
11
13
  Gemfile
12
14
  History.md
13
15
  LICENSE
@@ -16,12 +18,16 @@ README.rdoc
16
18
  Rakefile
17
19
  bin/pmdtester
18
20
  config/all-java.xml
21
+ config/custom.jfc
19
22
  config/design.xml
23
+ config/project-list-with-cpd.xml
20
24
  config/project-list.xml
21
25
  config/projectlist_1_0_0.xsd
22
26
  config/projectlist_1_1_0.xsd
23
27
  config/projectlist_1_2_0.xsd
28
+ config/projectlist_1_3_0.xsd
24
29
  lib/pmdtester.rb
30
+ lib/pmdtester/builders/cpd_project_hasher.rb
25
31
  lib/pmdtester/builders/liquid_renderer.rb
26
32
  lib/pmdtester/builders/pmd_report_builder.rb
27
33
  lib/pmdtester/builders/project_builder.rb
@@ -31,6 +37,10 @@ lib/pmdtester/builders/simple_progress_logger.rb
31
37
  lib/pmdtester/builders/summary_report_builder.rb
32
38
  lib/pmdtester/cmd.rb
33
39
  lib/pmdtester/collection_by_file.rb
40
+ lib/pmdtester/cpd_report_diff.rb
41
+ lib/pmdtester/jfr_summary.rb
42
+ lib/pmdtester/location.rb
43
+ lib/pmdtester/parsers/cpd_report_document.rb
34
44
  lib/pmdtester/parsers/options.rb
35
45
  lib/pmdtester/parsers/pmd_report_document.rb
36
46
  lib/pmdtester/parsers/projects_parser.rb
@@ -45,6 +55,8 @@ lib/pmdtester/report_diff.rb
45
55
  lib/pmdtester/resource_locator.rb
46
56
  lib/pmdtester/runner.rb
47
57
  lib/pmdtester/semver.rb
58
+ lib/pmdtester/system_info.rb
59
+ lib/pmdtester/word_differ.rb
48
60
  pmdtester.gemspec
49
61
  resources/_includes/diff_pill_row.html
50
62
  resources/css/bootstrap-5.3.0-alpha3.min.css
@@ -58,6 +70,7 @@ resources/js/jquery-3.6.4.slim.min.js
58
70
  resources/js/popper-2.11.7.min.js
59
71
  resources/js/project-report.js
60
72
  resources/maven-settings.xml
73
+ resources/project_cpd_report.html
61
74
  resources/project_diff_report.html
62
75
  resources/project_index.html
63
76
  resources/project_pmd_report.html
data/README.rdoc CHANGED
@@ -4,18 +4,24 @@ home :: https://pmd.github.io
4
4
  code :: https://github.com/pmd/pmd-regression-tester
5
5
  bugs :: https://github.com/pmd/pmd-regression-tester/issues
6
6
 
7
- build-status :: {<img src="https://github.com/pmd/pmd-regression-tester/workflows/build/badge.svg?branch=main" alt="Build Status" />}[https://github.com/pmd/pmd-regression-tester/actions?query=workflow%3Abuild]
7
+ build-status :: {rdoc-image:https://github.com/pmd/pmd-regression-tester/actions/workflows/build-snapshot.yml/badge.svg?branch=main}[https://github.com/pmd/pmd-regression-tester/actions/workflows/build-snapshot.yml]
8
8
 
9
- gem-version :: {<img src="https://badge.fury.io/rb/pmdtester.svg" alt="Gem Version" />}[https://rubygems.org/gems/pmdtester]
9
+ gem-version :: {rdoc-image:https://badge.fury.io/rb/pmdtester.svg}[https://rubygems.org/gems/pmdtester]
10
10
 
11
11
  == DESCRIPTION:
12
12
 
13
- A regression testing tool ensure that new problems and unexpected behaviors will not be introduced to PMD project after fixing an issue , and new rules can work as expected.
13
+ A regression testing tool ensure that new problems and unexpected behaviors will not be introduced to PMD project after fixing an issue
14
+ and new rules work as expected.
14
15
 
15
16
  == FEATURES/PROBLEMS:
16
17
 
17
18
  The diff report can be generated according to the base and patch branch of PMD
18
- on a list of standard projects(Spring Framework, Hibernate, Solr, etc.)
19
+ on a list of standard projects (e.g. Spring Framework, Checkstyle, OpenJDK, etc.).
20
+
21
+ Rule violations and code duplications are compared to report, which are new, removed or changed.
22
+
23
+ While executing PMD, JDK Flight Recorder (jfr) is enabled and a recording is created. This allows to investigate
24
+ performance and memory issues afterwards.
19
25
 
20
26
  == SYNOPSIS:
21
27
 
@@ -42,6 +48,8 @@ on a list of standard projects(Spring Framework, Hibernate, Solr, etc.)
42
48
  -d, --debug whether change log level to DEBUG to see more information
43
49
  --error-recovery enable error recovery mode when executing PMD. Might help to analyze errors.
44
50
  --baseline-download-url download url prefix from where to download the baseline in online mode
51
+ --no-cpd do not execute CPD (Copy Paste Detector) and compare duplications; only execute PMD
52
+ --no-pmd do not execute PMD and compare rule violations; only execute CPD (Copy Paste Detector)
45
53
  -v, --version
46
54
  -h, --help
47
55
 
@@ -71,17 +79,26 @@ The tool creates the following folders:
71
79
  │ ├── PATCH_BRANCH_NAME <- the patch baseline is placed here
72
80
  │ └── diff
73
81
  │ ├── index.html <- the summary report of diff reports
82
+ | ├── summary.txt <- short summary in text form to be used as a PR comment
83
+ | ├── conclusion.txt <- GitHub action check conclusion (e.g. 'neutral' or 'success')
74
84
  │ ├── base_config.xml <- pmd config from the base branch
75
85
  │ ├── patch_config.xml <- pmd config from the patch branch
76
86
  │ ├── css <- css resources are placed here
77
87
  │ ├── js <- js resources
78
88
  │ ├── PROJECT_NAME_1
79
- │ │ ├── project_data.js <- contains the violations as js/json
80
- └── index.html <- the diff report of PROJECT_1
89
+ │ │ ├── diff_pmd_data.js <- contains the violations as js/json
90
+ | | ├── diff_cpd_data.js <- contains the duplications as js/json
91
+ │ │ ├── index.html <- the diff report of PROJECT_1
92
+ | | ├── base_pmd_report.html <- full pmd report of the baseline
93
+ | | ├── base_cpd_report.html <- full cpd report of the baseline
94
+ | | ├── patch_pmd_report.html <- full pmd report of the patch branch
95
+ | | └── patch_cpd_report.html <- full cpd report of the baseline
81
96
  │ ├── .......
82
97
  │ └── PROJECT_NAME_n
83
- │ ├── project_data.js <- contains the violations as js/json
84
- └── index.xml <- the diff report of PROJECT_N
98
+ │ ├── diff_pmd_data.js <- contains the violations as js/json
99
+ ├── diff_cpd_data.js <- contains the duplications as js/json
100
+ │ ├── index.html <- the diff report of PROJECT_N
101
+ │ └── ...
85
102
  ├── pmd-bin-<version>-<branch_name>-<sha1> <- cached pmd builds that are reused
86
103
  └── pmd-bin-....
87
104
 
@@ -89,43 +106,46 @@ The tool creates the following folders:
89
106
  branch_name
90
107
  ├── branch_info.json
91
108
  ├── config.xml
109
+ ├── project-list.xml
92
110
  ├── STANDARD_PROJECT_NAME_1
93
- │ ├── report_info.json
94
- └── pmd_report.xml
111
+ │ ├── pmd_report_info.json
112
+ ├── pmd_report.xml
113
+ │ ├── cpd_report_info.json
114
+ │ └── cpd_report.xml
95
115
  ├── ......................
96
- │ ├── report_info.json
97
- │ └── pmd_report.xml
98
116
  └── STANDARD_PROJECT_NAME_n
99
- ├── report_info.info
100
- └── pmd_report.xml
117
+ ├── pmd_report_info.info
118
+ ├── pmd_report.xml
119
+ ├── cpd_report_info.info
120
+ └── cpd_report.xml
101
121
 
102
122
  == REQUIREMENTS:
103
123
 
104
- * Ruby 3.3 or higher
124
+ * Ruby 4 or higher
105
125
 
106
126
  === Runtime dependency
107
127
 
108
- nokogiri ~> 1.18
128
+ nokogiri ~> 1.19
109
129
  slop ~> 4.10
110
- differ ~> 0.1
111
130
  rufus-scheduler ~> 3.9
112
- logger-colors ~> 1.0
113
- liquid ~> 5.8
114
- base64 ~> 0.2
115
- bigdecimal ~> 3.1
116
- logger ~> 1.6
131
+ logger-colors ~> 1.1
132
+ liquid ~> 5.11
133
+ base64 ~> 0.3
134
+ bigdecimal ~> 4.0
135
+ logger ~> 1.7
117
136
 
118
137
  === Development dependency
119
138
 
120
- hoe ~> 4.2
139
+ hoe ~> 4.6
121
140
  hoe-bundler ~> 1.5
122
141
  hoe-git ~> 1.6
123
- minitest ~> 5.25
124
- mocha ~> 2.7
125
- rubocop ~> 1.74
126
- test-unit ~> 3.6
127
- rdoc ~> 6.12
128
- rake ~> 13.2
142
+ minitest ~> 6.0
143
+ mocha ~> 3.0
144
+ rubocop ~> 1.84
145
+ test-unit ~> 3.7
146
+ rdoc ~> 7.2
147
+ rake ~> 13.3
148
+ debug ~> 1.11
129
149
 
130
150
  == INSTALL:
131
151
 
@@ -154,6 +174,32 @@ The tool creates the following folders:
154
174
  Run a single test, e.g.:
155
175
  bundle exec ruby -I test test/test_project_diff_report.rb -n test_diff_report_builder
156
176
 
177
+ === Debugging
178
+
179
+ This assumes using vscode[https://code.visualstudio.com/] with the extension {Ruby LSP}[https://marketplace.visualstudio.com/items?itemName=Shopify.ruby-lsp].
180
+
181
+ * Execute a single test with debugger:
182
+
183
+ bundle exec rdbg --open --command -- ruby -Itest test/test_word_differ.rb -n test_simple_difference
184
+
185
+ * The debugger will wait, until a debugging session is attached. You can use the "Attach debugger" run configuration in vscode.
186
+
187
+ * In case, Ruby LSP doesn't find an locally running debugger ("No debuggee processes found"), you might need to explicitly set the debugger socket
188
+
189
+ # find local debugger sockets
190
+ bundle exec rdbg --util=list-socks
191
+
192
+ * Then change "Attach debugger to socket" config to specify a "debugSocketPath" explicitly and run this:
193
+
194
+ {
195
+ "type": "ruby_lsp",
196
+ "name": "Attach debugger to socket",
197
+ "request": "attach",
198
+ "debugSocketPath": "/run/user/1000/rdbg-382154"
199
+ }
200
+
201
+ Note: The socket changes for every debugging session.
202
+
157
203
  === Releasing
158
204
 
159
205
  * Update +History.md+ (version and date)
@@ -167,5 +213,6 @@ The tool creates the following folders:
167
213
  * Push to main.
168
214
  * Push the tag. Github Actions will build and publish the new gem
169
215
  * A github release is automatically created, verify it on https://github.com/pmd/pmd-regression-tester/releases
170
- * To make pmd's main CI use the new version (in [pmd/pmd](https://github.com/pmd/pmd/)), go to the root directory and run `bundle lock --update`. Commit these changes.
216
+ * To make pmd's main CI use the new version (in {pmd/pmd}[https://github.com/pmd/pmd/]),
217
+ go to the directory ".ci/files" and run `bundle lock --update`. Commit these changes.
171
218
  * Rename milestone to version, close it and create a new "Next" milestone: https://github.com/pmd/pmd-regression-tester/milestones
data/Rakefile CHANGED
@@ -20,28 +20,28 @@ hoe = Hoe.spec 'pmdtester' do
20
20
 
21
21
  self.clean_globs = %w[target/reports/**/* target/test/**/* target/dynamic-config.xml]
22
22
  self.extra_deps += [
23
- ['nokogiri', '~> 1.18'],
23
+ ['nokogiri', '~> 1.19'],
24
24
  ['slop', '~> 4.10'],
25
- ['differ', '~> 0.1'],
26
25
  ['rufus-scheduler', '~> 3.9'],
27
- ['logger-colors', '~> 1.0'],
28
- ['liquid', '~> 5.8'],
26
+ ['logger-colors', '~> 1.1'],
27
+ ['liquid', '~> 5.11'],
29
28
  ['base64', '~> 0.3'],
30
- ['bigdecimal', '~> 3.2'],
29
+ ['bigdecimal', '~> 4.0'],
31
30
  ['logger', '~> 1.7']
32
31
  ]
33
32
  self.extra_dev_deps += [
34
33
  ['hoe-bundler', '~> 1.5'],
35
34
  ['hoe-git', '~> 1.6'],
36
- ['minitest', '~> 5.25'],
37
- ['mocha', '~> 2.7'],
38
- ['rubocop', '~> 1.79'],
35
+ ['minitest', '~> 6.0'],
36
+ ['mocha', '~> 3.0'],
37
+ ['rubocop', '~> 1.84'],
39
38
  ['test-unit', '~> 3.7'],
40
- ['rdoc', '~> 6.12'],
39
+ ['rdoc', '~> 7.2'],
41
40
  ['rake', '~> 13.3'],
42
- ['hoe', '~> 4.2'],
41
+ ['hoe', '~> 4.6'],
42
+ ['debug', '~> 1.11']
43
43
  ]
44
- spec_extras[:required_ruby_version] = '>= 3.3'
44
+ spec_extras[:required_ruby_version] = '>= 4'
45
45
 
46
46
  license 'BSD-2-Clause'
47
47
  end