pmdtester 1.1.0 → 1.3.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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/build.sh +85 -77
  3. data/.ci/inc/fetch_ci_scripts.bash +19 -0
  4. data/.ci/manual-integration-tests.sh +37 -0
  5. data/.github/workflows/build.yml +26 -9
  6. data/.github/workflows/manual-integration-tests.yml +48 -0
  7. data/.hoerc +1 -1
  8. data/.rubocop.yml +3 -0
  9. data/History.md +44 -0
  10. data/Manifest.txt +6 -1
  11. data/README.rdoc +23 -18
  12. data/Rakefile +1 -1
  13. data/config/project-list.xml +8 -7
  14. data/config/projectlist_1_2_0.xsd +39 -0
  15. data/lib/pmdtester/builders/liquid_renderer.rb +60 -3
  16. data/lib/pmdtester/builders/pmd_report_builder.rb +15 -5
  17. data/lib/pmdtester/builders/project_builder.rb +14 -9
  18. data/lib/pmdtester/builders/project_hasher.rb +44 -42
  19. data/lib/pmdtester/builders/rule_set_builder.rb +4 -0
  20. data/lib/pmdtester/builders/summary_report_builder.rb +1 -0
  21. data/lib/pmdtester/parsers/options.rb +5 -0
  22. data/lib/pmdtester/parsers/pmd_report_document.rb +0 -2
  23. data/lib/pmdtester/parsers/projects_parser.rb +1 -1
  24. data/lib/pmdtester/pmd_branch_detail.rb +6 -0
  25. data/lib/pmdtester/pmd_report_detail.rb +1 -1
  26. data/lib/pmdtester/pmd_tester_utils.rb +5 -2
  27. data/lib/pmdtester/project.rb +24 -11
  28. data/lib/pmdtester/report_diff.rb +36 -10
  29. data/lib/pmdtester/runner.rb +2 -1
  30. data/lib/pmdtester/semver.rb +36 -0
  31. data/lib/pmdtester.rb +2 -1
  32. data/pmdtester.gemspec +8 -8
  33. data/resources/css/pmd-tester.css +18 -1
  34. data/resources/js/code-snippets.js +62 -22
  35. data/resources/js/project-report.js +6 -4
  36. data/resources/project_diff_report.html +9 -0
  37. data/resources/project_index.html +11 -0
  38. data/resources/project_pmd_report.html +186 -0
  39. metadata +15 -10
  40. data/.ci/files/env.gpg +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e64c3cfe9a13d470c09fee954176bda926c290cf1c518f889cac6ed8581a2ccd
4
- data.tar.gz: '091269caea70c24b02b138a6eb1b5292896c7fd7fffe3f3c38c8811dfa951db9'
3
+ metadata.gz: 3ab10c148f66f7b8d8942096da3c67260b0a50bc6f0a7671993f86035186c228
4
+ data.tar.gz: 11175641f5912e24ea5a623fe105392a9507ec0ad43156e223f8cefeea92bd7f
5
5
  SHA512:
6
- metadata.gz: 744b359c60b9ac0f8349c0b94ebbd8923f09fdd06aea2ad5d88f8d983ea86f33f9a9105385efc9f553b35690c30dbac8533577a68301ef1ef5700e01964212a1
7
- data.tar.gz: 6ee40e8927802f6e70e299629bec1b950feb0c388ced3e74a8982a014d4895f3dd76c04c055e91d4ef9881c037c189c9cfbbafe9cfc252c9a760cf9aaf0c17b0
6
+ metadata.gz: 543126b2c957bfefdd5d5985e0e6bbca6c7442fb8bb826abda65b86c9dd6956f4d704afb66f9b4fb2080acff72fbc6619bc76f6202919c70b99a55a98dd3a644
7
+ data.tar.gz: f10d380a93eb631fa5e2c4a60fc73795cfeb3a589002da0655c19900daea6445a2cf5f0ecc449c043594d0dd0fb3b27f4203c5ac442d7539b19b4ab63bd915ea
data/.ci/build.sh CHANGED
@@ -1,91 +1,99 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ # Exit this script immediately if a command/function exits with a non-zero status.
3
4
  set -e
4
5
 
5
-
6
- function build_regression_tester() {
7
- echo "::group::Install OpenJDK 8+11"
8
- install_openjdk 8
9
- install_openjdk 11 # last one is the default
10
- echo "::endgroup::"
11
-
12
- echo "::group::Install dependencies"
13
- gem install bundler
14
- bundle config set --local path vendor/bundle
15
- bundle install
16
- echo "::endgroup::"
17
-
18
- echo "::group::Build with rake"
19
- bundle exec rake check_manifest
20
- bundle exec rake rubocop
21
- bundle exec rake clean test
22
- echo "::endgroup::"
23
-
24
- echo "::group::Run Integration Tests"
25
- bundle exec rake clean integration-test
26
- echo "::endgroup::"
27
-
28
- echo "::group::Build Package"
29
- bundle exec rake install_gem
30
- bundle exec pmdtester -h
31
- echo "::endgroup::"
32
-
33
- # builds on forks or builds for pull requests stop here
34
- if [[ "${PMD_CI_REPO}" != "pmd/pmd-regression-tester" || -n "${PMD_CI_PULL_REQUEST_NUMBER}" ]]; then
6
+ SCRIPT_INCLUDES="log.bash utils.bash setup-secrets.bash openjdk.bash github-releases-api.bash"
7
+ # shellcheck source=inc/fetch_ci_scripts.bash
8
+ source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
9
+
10
+ function build() {
11
+ pmd_ci_log_group_start "Install OpenJDK 8+11"
12
+ pmd_ci_openjdk_install_adoptium 11
13
+ pmd_ci_openjdk_install_adoptium 8
14
+ pmd_ci_openjdk_setdefault 11
15
+ pmd_ci_log_group_end
16
+
17
+ pmd_ci_log_group_start "Install dependencies"
18
+ gem install --user-install bundler
19
+ bundle config set --local path vendor/bundle
20
+ bundle install
21
+ pmd_ci_log_group_end
22
+
23
+ echo
24
+ local version
25
+ version="$(bundle exec ruby -I. -e 'require "lib/pmdtester"; print PmdTester::VERSION;')"
26
+ pmd_ci_log_info "======================================================================="
27
+ pmd_ci_log_info "Building pmd-regression-tester ${version}"
28
+ pmd_ci_log_info "======================================================================="
29
+ pmd_ci_utils_determine_build_env pmd/pmd-regression-tester
30
+ echo
31
+
32
+ pmd_ci_log_group_start "Build with rake"
33
+ bundle exec rake check_manifest
34
+ bundle exec rake rubocop
35
+ bundle exec rake clean test
36
+ pmd_ci_log_group_end
37
+
38
+ pmd_ci_log_group_start "Run Integration Tests"
39
+ bundle exec rake clean integration-test
40
+ pmd_ci_log_group_end
41
+
42
+ pmd_ci_log_group_start "Build Package"
43
+ bundle exec rake install_gem
44
+ bundle exec pmdtester -h
45
+ pmd_ci_log_group_end
46
+
47
+ if pmd_ci_utils_is_fork_or_pull_request; then
48
+ # builds on forks or builds for pull requests stop here
35
49
  exit 0
36
50
  fi
37
51
 
38
- # if this is a release build from a tag...
39
- if [[ "${PMD_CI_REPO}" == "pmd/pmd-regression-tester" && "${PMD_CI_GIT_REF}" == refs/tags/* ]]; then
40
- echo "::group::Publish to rubygems"
41
- setup_secrets
42
-
43
- git stash --all
44
- gem build pmdtester.gemspec
45
- gem push pmdtester-*.gem
46
- echo "::endgroup::"
52
+ # only builds on pmd/pmd-regression-tester continue here
53
+ pmd_ci_log_group_start "Setup environment"
54
+ pmd_ci_setup_secrets_private_env
55
+ pmd_ci_log_group_end
56
+
57
+ if isReleaseBuild "$version"; then
58
+ pmd_ci_log_group_start "Publish to rubygems"
59
+ gem build pmdtester.gemspec
60
+ local gempkgfile
61
+ gempkgfile="$(echo pmdtester-*.gem)"
62
+ gem push "${gempkgfile}"
63
+ pmd_ci_log_group_end
64
+
65
+ pmd_ci_log_group_start "Update Github Releases"
66
+ # create a draft github release
67
+ pmd_ci_gh_releases_createDraftRelease "${PMD_CI_TAG}" "$(git rev-list -n 1 "${PMD_CI_TAG}")"
68
+ GH_RELEASE="$RESULT"
69
+
70
+ # Deploy to github releases
71
+ pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "${gempkgfile}"
72
+
73
+ # extract the release notes
74
+ RELEASE_NAME="${version}"
75
+ BEGIN_LINE=$(grep -n "^# " History.md|head -1|cut -d ":" -f 1)
76
+ BEGIN_LINE=$((BEGIN_LINE + 1))
77
+ END_LINE=$(grep -n "^# " History.md|head -2|tail -1|cut -d ":" -f 1)
78
+ END_LINE=$((END_LINE - 1))
79
+ RELEASE_BODY="$(head -$END_LINE History.md | tail -$((END_LINE - BEGIN_LINE)))"
80
+
81
+ pmd_ci_gh_releases_updateRelease "$GH_RELEASE" "$RELEASE_NAME" "$RELEASE_BODY"
82
+
83
+ # Publish release - this sends out notifications on github
84
+ pmd_ci_gh_releases_publishRelease "$GH_RELEASE"
85
+ pmd_ci_log_group_end
47
86
  fi
48
-
49
87
  }
50
88
 
51
- ## helper functions
52
-
53
- function install_openjdk() {
54
- OPENJDK_VERSION=$1
55
- echo "Installing OpenJDK ${OPENJDK_VERSION}"
56
- JDK_OS=linux
57
- COMPONENTS_TO_STRIP=1 # e.g. openjdk-11.0.3+7/bin/java
58
- DOWNLOAD_URL=$(curl --silent -X GET "https://api.adoptopenjdk.net/v3/assets/feature_releases/${OPENJDK_VERSION}/ga?architecture=x64&heap_size=normal&image_type=jdk&jvm_impl=hotspot&os=${JDK_OS}&page=0&page_size=1&project=jdk&sort_method=DEFAULT&sort_order=DESC&vendor=adoptopenjdk" \
59
- -H "accept: application/json" \
60
- | jq -r ".[0].binaries[0].package.link")
61
- OPENJDK_ARCHIVE=$(basename ${DOWNLOAD_URL})
62
- CACHE_DIR=${HOME}/.cache/openjdk
63
- TARGET_DIR=${HOME}/openjdk${OPENJDK_VERSION}
64
- mkdir -p ${CACHE_DIR}
65
- mkdir -p ${TARGET_DIR}
66
- if [ ! -e ${CACHE_DIR}/${OPENJDK_ARCHIVE} ]; then
67
- echo "Downloading from ${DOWNLOAD_URL} to ${CACHE_DIR}"
68
- curl --location --output ${CACHE_DIR}/${OPENJDK_ARCHIVE} "${DOWNLOAD_URL}"
69
- else
70
- echo "Skipped download, file ${CACHE_DIR}/${OPENJDK_ARCHIVE} already exists"
89
+ function isReleaseBuild() {
90
+ local version="$1"
91
+
92
+ if [[ "${version}" != *-SNAPSHOT && "${PMD_CI_TAG}" != "" ]]; then
93
+ return 0
71
94
  fi
72
- tar --extract --file ${CACHE_DIR}/${OPENJDK_ARCHIVE} -C ${TARGET_DIR} --strip-components=${COMPONENTS_TO_STRIP}
73
- export JAVA_HOME="${TARGET_DIR}"
74
- export PATH="${TARGET_DIR}/bin:${PATH}"
75
- java -version
76
- echo "Java is available at ${TARGET_DIR}"
77
- }
78
95
 
79
- function setup_secrets() {
80
- echo "Setting up secrets..."
81
- # Required secrets are: GEM_HOST_API_KEY
82
- local -r env_file=".ci/files/env"
83
- printenv PMD_CI_SECRET_PASSPHRASE | gpg --batch --yes --decrypt \
84
- --passphrase-fd 0 \
85
- --output ${env_file} ${env_file}.gpg
86
- source ${env_file} >/dev/null 2>&1
87
- rm ${env_file}
96
+ return 1
88
97
  }
89
98
 
90
-
91
- build_regression_tester
99
+ build
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env bash
2
+
3
+ function fetch_ci_scripts() {
4
+ local inc_dir
5
+ local inc_url
6
+ inc_dir="$(dirname "$0")/inc"
7
+ inc_url="${PMD_CI_SCRIPTS_URL:-https://raw.githubusercontent.com/pmd/build-tools/master/scripts}/inc"
8
+
9
+ mkdir -p "${inc_dir}"
10
+
11
+ for f in ${SCRIPT_INCLUDES}; do
12
+ if [ ! -e "${inc_dir}/$f" ]; then
13
+ curl -sSL "${inc_url}/$f" > "${inc_dir}/$f"
14
+ fi
15
+ [ "$PMD_CI_DEBUG" = "true" ] && echo "loading ${inc_dir}/$f in ${MODULE:-$0}"
16
+ # shellcheck source=/dev/null
17
+ source "${inc_dir}/$f" || exit 1
18
+ done
19
+ }
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Exit this script immediately if a command/function exits with a non-zero status.
4
+ set -e
5
+
6
+ SCRIPT_INCLUDES="log.bash utils.bash openjdk.bash"
7
+ # shellcheck source=inc/fetch_ci_scripts.bash
8
+ source "$(dirname "$0")/inc/fetch_ci_scripts.bash" && fetch_ci_scripts
9
+
10
+ function build() {
11
+ pmd_ci_log_group_start "Install OpenJDK 8+11"
12
+ pmd_ci_openjdk_install_adoptium 11
13
+ pmd_ci_openjdk_install_adoptium 8
14
+ pmd_ci_openjdk_setdefault 11
15
+ pmd_ci_log_group_end
16
+
17
+ pmd_ci_log_group_start "Install dependencies"
18
+ gem install --user-install bundler
19
+ bundle config set --local path vendor/bundle
20
+ bundle install
21
+ pmd_ci_log_group_end
22
+
23
+ echo
24
+ local version
25
+ version="$(bundle exec ruby -I. -e 'require "lib/pmdtester"; print PmdTester::VERSION;')"
26
+ pmd_ci_log_info "======================================================================="
27
+ pmd_ci_log_info "Building pmd-regression-tester ${version}"
28
+ pmd_ci_log_info "======================================================================="
29
+ pmd_ci_utils_determine_build_env pmd/pmd-regression-tester
30
+ echo
31
+
32
+ pmd_ci_log_group_start "Run Manual Integration Tests"
33
+ bundle exec ruby -I test test/manual_integration_tests.rb
34
+ pmd_ci_log_group_end
35
+ }
36
+
37
+ build
@@ -2,11 +2,16 @@ name: build
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ master ]
5
+ branches:
6
+ - main
7
+ - master
6
8
  tags:
7
9
  - '**'
8
10
  pull_request:
9
- branches: [ master ]
11
+ schedule:
12
+ # build it monthly: At 04:30 on day-of-month 1.
13
+ - cron: '30 4 1 * *'
14
+ workflow_dispatch:
10
15
 
11
16
  jobs:
12
17
  build:
@@ -21,19 +26,31 @@ jobs:
21
26
  ~/.m2/repository
22
27
  ~/.cache
23
28
  vendor/bundle
24
- key: ${{ runner.os }}-${{ hashFiles('pmdtester.gemspec') }}
29
+ target/repositories
30
+ key: v1-${{ runner.os }}-${{ hashFiles('pmdtester.gemspec') }}
25
31
  restore-keys: |
26
- ${{ runner.os }}-
27
- - name: Set up Ruby
32
+ v1-${{ runner.os }}-
33
+ - name: Set up Ruby 2.7
28
34
  uses: ruby/setup-ruby@v1
29
35
  with:
30
36
  ruby-version: 2.7
37
+ - name: Setup Environment
38
+ shell: bash
39
+ run: |
40
+ echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
41
+ echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3" >> $GITHUB_ENV
42
+ echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/17/scripts" >> $GITHUB_ENV
43
+ - name: Check Environment
44
+ shell: bash
45
+ run: |
46
+ f=check-environment.sh; \
47
+ mkdir -p .ci && \
48
+ ( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
49
+ chmod 755 .ci/$f && \
50
+ .ci/$f
31
51
  - name: Build
32
52
  run: .ci/build.sh
33
53
  shell: bash
34
54
  env:
35
- MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3
36
55
  PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
37
- PMD_CI_REPO: ${{ github.repository }}
38
- PMD_CI_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
39
- PMD_CI_GIT_REF: ${{ github.ref }}
56
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,48 @@
1
+ name: manual-integration-tests
2
+
3
+ on:
4
+ schedule:
5
+ # build it monthly: At 08:30 on day-of-month 1.
6
+ - cron: '30 8 1 * *'
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ continue-on-error: false
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - uses: actions/cache@v2
16
+ with:
17
+ path: |
18
+ ~/.m2/repository
19
+ ~/.cache
20
+ vendor/bundle
21
+ target/repositories
22
+ key: v1-${{ runner.os }}-${{ hashFiles('pmdtester.gemspec') }}
23
+ restore-keys: |
24
+ v1-${{ runner.os }}-
25
+ - name: Set up Ruby 2.7
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: 2.7
29
+ - name: Setup Environment
30
+ shell: bash
31
+ run: |
32
+ echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
33
+ echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3" >> $GITHUB_ENV
34
+ echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/17/scripts" >> $GITHUB_ENV
35
+ - name: Check Environment
36
+ shell: bash
37
+ run: |
38
+ f=check-environment.sh; \
39
+ mkdir -p .ci && \
40
+ ( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
41
+ chmod 755 .ci/$f && \
42
+ .ci/$f
43
+ - name: Build
44
+ run: .ci/manual-integration-tests.sh
45
+ shell: bash
46
+ env:
47
+ PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
48
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
data/.hoerc CHANGED
@@ -1 +1 @@
1
- exclude: !ruby/regexp /tmp$|\.(git|idea)\/|\.project|target|test\/|Gemfile\.lock|\.bundle\/|vendor\/bundle|localtests/
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/
data/.rubocop.yml CHANGED
@@ -27,3 +27,6 @@ Metrics/ClassLength:
27
27
  Metrics/BlockLength:
28
28
  Exclude:
29
29
  - 'lib/pmdtester/parsers/options.rb'
30
+
31
+ Metrics/ModuleLength:
32
+ CountAsOne: ['array', 'hash']
data/History.md CHANGED
@@ -1,3 +1,47 @@
1
+ # 1.3.0 / 2021-12-17
2
+
3
+ ## Enhancements
4
+
5
+ * [#94](https://github.com/pmd/pmd-regression-tester/issues/94): Improve code snippet preview
6
+ * [#95](https://github.com/pmd/pmd-regression-tester/issues/95): Add length menu for datatable to allow configurable page size
7
+
8
+ ## Fixed Issues
9
+
10
+ * [#86](https://github.com/pmd/pmd-regression-tester/issues/86): Uncaught TypeError: violation is undefined
11
+ * [#93](https://github.com/pmd/pmd-regression-tester/issues/93): Line numbers > 1000 are not displayed correctly
12
+ * [#96](https://github.com/pmd/pmd-regression-tester/issues/96): Fix failing integration tests
13
+
14
+ # 1.2.0 / 2021-06-20
15
+
16
+ ## New and Noteworthy
17
+
18
+ * Support for Mercurial is removed. The only SCM supported in the project-list.xml is "git".
19
+
20
+ ## Fixed Issues
21
+
22
+ * [#71](https://github.com/pmd/pmd-regression-tester/issues/71): Include full PMD report
23
+ * [#89](https://github.com/pmd/pmd-regression-tester/pull/89): Make it possible to select a subpath of cloned directory
24
+ * [#91](https://github.com/pmd/pmd-regression-tester/pull/91): Filter baseline based on patch config
25
+
26
+ # 1.1.2 / 2021-04-20
27
+
28
+ This is a bugfix release.
29
+
30
+ ## Fixed Issues
31
+
32
+ * [#85](https://github.com/pmd/pmd-regression-tester/issues/85): HTML is not escaped in snippet preview
33
+ * [#84](https://github.com/pmd/pmd-regression-tester/issues/84): Leading spaces are missing in code snippet preview
34
+
35
+ # 1.1.1 / 2021-01-15
36
+
37
+ This is a bugfix release.
38
+
39
+ ## Fixed Issues
40
+
41
+ * [#81](https://github.com/pmd/pmd-regression-tester/pull/81): Dynamically generated rulesets are not applied on diffs
42
+ * [#82](https://github.com/pmd/pmd-regression-tester/pull/82): Summary hash uses wrong key names
43
+ * An already built PMD binary was not reused in CI
44
+
1
45
  # 1.1.0 / 2020-12-05
2
46
 
3
47
  ## New and Noteworthy
data/Manifest.txt CHANGED
@@ -1,6 +1,8 @@
1
1
  .ci/build.sh
2
- .ci/files/env.gpg
2
+ .ci/inc/fetch_ci_scripts.bash
3
+ .ci/manual-integration-tests.sh
3
4
  .github/workflows/build.yml
5
+ .github/workflows/manual-integration-tests.yml
4
6
  .gitignore
5
7
  .hoerc
6
8
  .rubocop.yml
@@ -18,6 +20,7 @@ config/design.xml
18
20
  config/project-list.xml
19
21
  config/projectlist_1_0_0.xsd
20
22
  config/projectlist_1_1_0.xsd
23
+ config/projectlist_1_2_0.xsd
21
24
  lib/pmdtester.rb
22
25
  lib/pmdtester/builders/liquid_renderer.rb
23
26
  lib/pmdtester/builders/pmd_report_builder.rb
@@ -41,6 +44,7 @@ lib/pmdtester/project.rb
41
44
  lib/pmdtester/report_diff.rb
42
45
  lib/pmdtester/resource_locator.rb
43
46
  lib/pmdtester/runner.rb
47
+ lib/pmdtester/semver.rb
44
48
  pmdtester.gemspec
45
49
  resources/_includes/diff_pill_row.html
46
50
  resources/css/bootstrap.min.css
@@ -55,3 +59,4 @@ resources/js/popper.min.js
55
59
  resources/js/project-report.js
56
60
  resources/project_diff_report.html
57
61
  resources/project_index.html
62
+ resources/project_pmd_report.html
data/README.rdoc CHANGED
@@ -20,29 +20,30 @@ on a list of standard projects(Spring Framework, Hibernate, Solr, etc.)
20
20
  == SYNOPSIS:
21
21
 
22
22
  === Options:
23
- -r, --local-git-repo path to the local PMD repository
24
- -b, --base-branch name of the base branch in local PMD repository
25
- -p, --patch-branch name of the patch branch in local PMD repository
26
- -bc, --base-config path to the base PMD configuration file default:PMDTESTER_INSTALLED_DIR/config/all-java.xml
27
- -pc, --patch-config path to the patch PMD configuration file default:PMDTESTER_INSTALLED_DIR/config/all-java.xml
28
- -c, --config path to the base and patch PMD configuration file
29
- -l, --list-of-project path to the file which contains the list of standard projects default:PMDTESTER_INSTALLED_DIR/config/project-list.xml
30
- -m, --mode the mode of the tool: 'local', 'online' or 'single'
23
+ -r, --local-git-repo path to the local PMD repository
24
+ -b, --base-branch name of the base branch in local PMD repository
25
+ -p, --patch-branch name of the patch branch in local PMD repository
26
+ -bc, --base-config path to the base PMD configuration file
27
+ -pc, --patch-config path to the patch PMD configuration file
28
+ -c, --config path to the base and patch PMD configuration file
29
+ -l, --list-of-project path to the file which contains the list of standard projects
30
+ -m, --mode the mode of the tool: 'local', 'online' or 'single'
31
31
  single: Set this option to 'single' if your patch branch contains changes
32
32
  for any option that can't work on master/base branch
33
33
  online: Set this option to 'online' if you want to download
34
34
  the PMD report of master/base branch rather than generating it locally
35
35
  local: Default option is 'local', PMD reports for the base and patch branches are generated locally.
36
36
 
37
- -t, --threads Sets the number of threads used by PMD. Set threads to 0 to disable multi-threading processing. default:1
38
- -f, --html-flag whether to not generate the html diff report in single mode
39
- -a, --auto-gen-config whether to generate configurations automatically based on branch differences,this option only works in online and local mode
40
- --keep-reports whether to keep old reports and skip running PMD again if possible
41
- -d, --debug whether change log level to DEBUG to see more information
42
- --error-recovery enable error recovery mode when executing PMD. Might help to analyze errors.
43
- --baseline-download-url download url prefix from where to download the baseline in online mode default:https://sourceforge.net/projects/pmd/files/pmd-regression-tester/
44
- -v, --version
45
- -h, --help
37
+ -t, --threads Sets the number of threads used by PMD. Set threads to 0 to disable multi-threading processing.
38
+ -f, --html-flag whether to not generate the html diff report in single mode
39
+ -a, --auto-gen-config whether to generate configurations automatically based on branch differences,this option only works in online and local mode
40
+ --filter-with-patch-config whether to use patch config to filter baseline result as if --auto-gen-config has been used. This option only works in online mode.
41
+ --keep-reports whether to keep old reports and skip running PMD again if possible
42
+ -d, --debug whether change log level to DEBUG to see more information
43
+ --error-recovery enable error recovery mode when executing PMD. Might help to analyze errors.
44
+ --baseline-download-url download url prefix from where to download the baseline in online mode
45
+ -v, --version
46
+ -h, --help
46
47
 
47
48
  === Quick start
48
49
 
@@ -104,10 +105,12 @@ The tool creates the following folders:
104
105
 
105
106
  === Runtime dependency
106
107
 
107
- nokogiri ~> 1.8
108
+ nokogiri >= 1.11.0.rc4
108
109
  slop ~> 4.6
109
110
  differ ~> 0.1
110
111
  rufus-scheduler ~> 3.5
112
+ logger-colors ~> 1.0
113
+ liquid >= 4.0
111
114
 
112
115
  === Development dependency
113
116
 
@@ -151,3 +154,5 @@ The tool creates the following folders:
151
154
  * Commit ("Prepare next development version x.y.z-SNAPSHOT").
152
155
  * Push to master.
153
156
  * Push the tag. Github Actions will build and publish the new gem
157
+ * A github release is automatically created, verify it on https://github.com/pmd/pmd-regression-tester/releases
158
+ * 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.
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ hoe = Hoe.spec 'pmdtester' do
19
19
  developer 'Clément Fournier', 'clement.fournier76@gmail.com'
20
20
 
21
21
  self.clean_globs = %w[target/reports/**/* target/test/**/* target/dynamic-config.xml Gemfile.lock]
22
- self.extra_deps += [['nokogiri', '~> 1.8'], ['slop', '~> 4.6'], ['differ', '~> 0.1'],
22
+ self.extra_deps += [['nokogiri', '>= 1.11.0.rc4'], ['slop', '~> 4.6'], ['differ', '~> 0.1'],
23
23
  ['rufus-scheduler', '~> 3.5'], ['logger-colors', '~> 1.0'],
24
24
  ['liquid', '>= 4.0']]
25
25
  self.extra_dev_deps += [
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
 
3
3
  <projectlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
- xsi:noNamespaceSchemaLocation="projectlist_1_0_0.xsd">
4
+ xsi:noNamespaceSchemaLocation="projectlist_1_2_0.xsd">
5
5
  <description>Standard Projects</description>
6
6
 
7
7
  <project>
@@ -20,10 +20,11 @@ xsi:noNamespaceSchemaLocation="projectlist_1_0_0.xsd">
20
20
  <tag>v5.0.6.RELEASE</tag>
21
21
  </project>
22
22
 
23
- <!---<project>
24
- <name>openjdk10</name>
25
- <type>hg</type>
26
- <connection>http://hg.openjdk.java.net/jdk10/jdk10/jdk</connection>
27
- <webview-url>http://hg.openjdk.java.net/jdk10/jdk10/jdk/file/777356696811</webview-url>
28
- </project> -->
23
+ <project>
24
+ <name>openjdk-11</name>
25
+ <type>git</type>
26
+ <connection>https://github.com/openjdk/jdk</connection>
27
+ <tag>jdk-11+28</tag>
28
+ <src-subpath>src/java.base</src-subpath>
29
+ </project>
29
30
  </projectlist>
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" ?>
2
+ <!-- version 1.1.0 -->
3
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
4
+ <xs:element name="projectlist">
5
+ <xs:complexType>
6
+ <xs:sequence>
7
+ <xs:element name="description" type="xs:string" minOccurs="1" maxOccurs="1"/>
8
+ <xs:element name="project" type="project" minOccurs="1" maxOccurs="unbounded"/>
9
+ </xs:sequence>
10
+ </xs:complexType>
11
+ </xs:element>
12
+ <xs:complexType name="project">
13
+ <xs:sequence>
14
+ <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1"/>
15
+ <xs:element name="type" minOccurs="1" maxOccurs="1">
16
+ <xs:simpleType>
17
+ <xs:restriction base="xs:string">
18
+ <xs:enumeration value="git"/>
19
+ </xs:restriction>
20
+ </xs:simpleType>
21
+ </xs:element>
22
+ <xs:element name="connection" type="xs:string" minOccurs="1" maxOccurs="1"/>
23
+ <xs:element name="webview-url" type="xs:string" minOccurs="0" maxOccurs="1"/>
24
+ <xs:element name="tag" type="xs:string" minOccurs="0" maxOccurs="1"/>
25
+ <xs:element name="src-subpath" type="xs:string" minOccurs="0" maxOccurs="1" default=".">
26
+ <xs:annotation>
27
+ <xs:documentation>
28
+ Value of the -dir option for the PMD run.
29
+ The value must be a directory path relative to the root directory of the clone.
30
+ Defaults to just '.', ie the entire directory.
31
+ </xs:documentation>
32
+ </xs:annotation>
33
+ </xs:element>
34
+ <xs:element name="exclude-pattern" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
35
+ <xs:element name="build-command" type="xs:string" minOccurs="0" maxOccurs="1"/>
36
+ <xs:element name="auxclasspath-command" type="xs:string" minOccurs="0" maxOccurs="1"/>
37
+ </xs:sequence>
38
+ </xs:complexType>
39
+ </xs:schema>