Merge branch 'master' into parametrize-assert-methods
This commit is contained in:
20 files changed
+212
-52
No files matched your search
@@ -7416,6 +7416,15 @@
|
||||
"contributions": [
|
||||
"financial"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "wangzitom12306",
|
||||
"name": "wangzitom12306",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/125560621?v=4",
|
||||
"profile": "https://github.com/wangzitom12306",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
|
||||
+36
-25
@@ -70,16 +70,34 @@ function build() {
|
||||
PMD_MAVEN_EXTRA_OPTS+=(-Dpmd.skip=true -Dcpd.skip=true)
|
||||
fi
|
||||
|
||||
# make sure, BUILD_CLI_DIST_ONLY is set to false by default
|
||||
pmd_ci_log_info "BUILD_CLI_DIST_ONLY=${BUILD_CLI_DIST_ONLY}"
|
||||
: "${BUILD_CLI_DIST_ONLY:=false}"
|
||||
pmd_ci_log_info "BUILD_CLI_DIST_ONLY=${BUILD_CLI_DIST_ONLY}"
|
||||
|
||||
if [ "$(pmd_ci_utils_get_os)" != "linux" ]; then
|
||||
pmd_ci_log_group_start "Build with mvnw"
|
||||
pmd_ci_log_group_start "Build with mvnw verify on $(pmd_ci_utils_get_os)"
|
||||
if pmd_ci_maven_isReleaseBuild; then
|
||||
pmd_ci_log_info "This is a release version build..."
|
||||
# There are two possible (release) builds:
|
||||
if [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then
|
||||
# a) everything without pmd-cli and pmd-dist
|
||||
./mvnw clean verify -P"${mvn_profiles}" -Dskip-cli-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
|
||||
else
|
||||
# b) only pmd-cli and pmd-dist
|
||||
./mvnw clean verify -P"${mvn_profiles}" -pl pmd-cli,pmd-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
|
||||
fi
|
||||
else
|
||||
# snapshot build - just verify on the different OS
|
||||
./mvnw clean verify --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
|
||||
fi
|
||||
pmd_ci_log_group_end
|
||||
|
||||
pmd_ci_log_info "Stopping build here, because os is not linux"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# only builds on pmd/pmd continue here
|
||||
# only builds on pmd/pmd on linux continue here
|
||||
pmd_ci_log_group_start "Setup environment"
|
||||
pmd_ci_setup_secrets_private_env
|
||||
pmd_ci_setup_secrets_gpg_key
|
||||
@@ -87,18 +105,6 @@ function build() {
|
||||
pmd_ci_maven_setup_settings
|
||||
pmd_ci_log_group_end
|
||||
|
||||
if [ "${PMD_CI_BRANCH}" = "experimental-apex-parser" ]; then
|
||||
pmd_ci_log_group_start "Build with mvnw"
|
||||
./mvnw clean install --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
|
||||
pmd_ci_log_group_end
|
||||
|
||||
pmd_ci_log_group_start "Creating new baseline for regression tester"
|
||||
regression_tester_setup_ci
|
||||
regression_tester_uploadBaseline
|
||||
pmd_ci_log_group_end
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pmd_ci_log_group_start "Build and Deploy"
|
||||
pmd_ci_build_run
|
||||
pmd_ci_deploy_build_artifacts
|
||||
@@ -156,6 +162,8 @@ function build() {
|
||||
jacoco:report -Pcoveralls,fastSkip
|
||||
|
||||
# workaround, maybe https://github.com/jacoco/jacoco/issues/654
|
||||
# we use $ as a regex separator, not a shell variable, so no expansion
|
||||
# shellcheck disable=SC2016
|
||||
sed -i 's$Comparisons.kt$ApexTreeBuilder.kt$g' pmd-apex/target/site/jacoco/jacoco.xml
|
||||
|
||||
# then create and send coveralls report
|
||||
@@ -254,20 +262,23 @@ function pmd_ci_deploy_build_artifacts() {
|
||||
# Renders release notes and uploads them as ReadMe.md to sourceforge
|
||||
#
|
||||
function pmd_ci_build_and_upload_doc() {
|
||||
pmd_doc_generate_jekyll_site
|
||||
pmd_doc_create_archive
|
||||
# generate the site only for snapshots from master and for release builds for case a) (everything without cli/dist)
|
||||
# to avoid building it twice during a release...
|
||||
if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "master" ] || [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then
|
||||
pmd_doc_generate_jekyll_site
|
||||
pmd_doc_create_archive
|
||||
|
||||
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
|
||||
if pmd_ci_maven_isReleaseBuild && [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then
|
||||
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
|
||||
fi
|
||||
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
|
||||
|
||||
# Deploy doc to https://docs.pmd-code.org/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/
|
||||
pmd_code_uploadDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
|
||||
# Deploy javadoc to https://docs.pmd-code.org/apidocs/*/${PMD_CI_MAVEN_PROJECT_VERSION}/
|
||||
pmd_code_uploadJavadoc "${PMD_CI_MAVEN_PROJECT_VERSION}" "$(pwd)"
|
||||
if pmd_ci_maven_isReleaseBuild; then
|
||||
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
|
||||
fi
|
||||
|
||||
# Deploy doc to https://docs.pmd-code.org/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/
|
||||
pmd_code_uploadDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
|
||||
# Deploy javadoc to https://docs.pmd-code.org/apidocs/*/${PMD_CI_MAVEN_PROJECT_VERSION}/
|
||||
pmd_code_uploadJavadoc "${PMD_CI_MAVEN_PROJECT_VERSION}" "$(pwd)"
|
||||
|
||||
if pmd_ci_maven_isSnapshotBuild || [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then
|
||||
# render release notes
|
||||
# updating github release text
|
||||
rm -f .bundle/config
|
||||
|
||||
@@ -5,7 +5,6 @@ on:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- experimental-apex-parser
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
@@ -61,7 +60,7 @@ jobs:
|
||||
run: |
|
||||
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
||||
echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/23/scripts" >> $GITHUB_ENV
|
||||
- name: Check Environment
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/23/scripts" >> $GITHUB_ENV
|
||||
- name: Sync
|
||||
run: .ci/git-repo-sync.sh
|
||||
shell: bash
|
||||
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
run: |
|
||||
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
|
||||
echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV
|
||||
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/23/scripts" >> $GITHUB_ENV
|
||||
- name: Check Environment
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
+2
-2
@@ -192,7 +192,7 @@ fi
|
||||
echo "Change version in the POMs to ${RELEASE_VERSION} and update build timestamp"
|
||||
./mvnw --quiet versions:set -DnewVersion="${RELEASE_VERSION}" -DgenerateBackupPoms=false -DupdateBuildOutputTimestampPolicy=always
|
||||
echo "Transform the SCM information in the POM"
|
||||
sed -i "s|<tag>.\+</tag>|<tag>pmd_releases/${RELEASE_VERSION}</tag>|" pom.xml
|
||||
sed -i "s|<tag>HEAD</tag>|<tag>pmd_releases/${RELEASE_VERSION}</tag>|" pom.xml
|
||||
echo "Run the project tests against the changed POMs to confirm everything is in running order (skipping cli and dist)"
|
||||
# note: skipping pmd in order to avoid failures due to #4757
|
||||
./mvnw clean verify -Dskip-cli-dist -Dpmd.skip=true -Dcpd.skip=true -Pgenerate-rule-docs
|
||||
@@ -201,7 +201,7 @@ git commit -a -m "[release] prepare release pmd_releases/${RELEASE_VERSION}"
|
||||
git tag -m "[release] copy for tag pmd_releases/${RELEASE_VERSION}" "pmd_releases/${RELEASE_VERSION}"
|
||||
echo "Update POMs to set the new development version ${DEVELOPMENT_VERSION}"
|
||||
./mvnw --quiet versions:set -DnewVersion="${DEVELOPMENT_VERSION}" -DgenerateBackupPoms=false -DupdateBuildOutputTimestampPolicy=never
|
||||
sed -i "s|<tag>.\+</tag>|<tag>HEAD</tag>|" pom.xml
|
||||
sed -i "s|<tag>pmd_releases/${RELEASE_VERSION}</tag>|<tag>HEAD</tag>|" pom.xml
|
||||
echo "Commit"
|
||||
git commit -a -m "[release] prepare for next development iteration"
|
||||
echo "Push branch and tag pmd_releases/${RELEASE_VERSION}"
|
||||
|
||||
+5
-2
@@ -61,6 +61,7 @@ feedback_disable: true
|
||||
# if you uncomment the previous line, it changes where the feedback link points to
|
||||
|
||||
|
||||
# filter used to process markdown. note that kramdown differs from github-flavored markdown in some subtle ways
|
||||
markdown: kramdown
|
||||
highlighter: rouge
|
||||
kramdown:
|
||||
@@ -70,8 +71,10 @@ kramdown:
|
||||
syntax_highlighter: rouge
|
||||
syntax_highlighter_opts:
|
||||
css_class: 'highlight'
|
||||
parse_block_html: true
|
||||
# filter used to process markdown. note that kramdown differs from github-flavored markdown in some subtle ways
|
||||
parse_block_html: false
|
||||
# selectively enable kramdown parsing for block html elements with attribute 'markdown="block"'
|
||||
# see https://kramdown.gettalong.org/syntax.html
|
||||
|
||||
|
||||
collections:
|
||||
tooltips:
|
||||
|
||||
@@ -38,6 +38,10 @@ details {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
details.no-background {
|
||||
background: white;
|
||||
}
|
||||
|
||||
details p {
|
||||
padding: 5px 10px 5px;
|
||||
background: white;
|
||||
|
||||
@@ -1027,29 +1027,30 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/triandicAnt"><img src="https://avatars.githubusercontent.com/u/2345902?v=4?s=100" width="100px;" alt="triandicAnt"/><br /><sub><b>triandicAnt</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3AtriandicAnt" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/trishul14"><img src="https://avatars.githubusercontent.com/u/24551131?v=4?s=100" width="100px;" alt="trishul14"/><br /><sub><b>trishul14</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Atrishul14" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xmtsui"><img src="https://avatars.githubusercontent.com/u/1542690?v=4?s=100" width="100px;" alt="tsui"/><br /><sub><b>tsui</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Axmtsui" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wangzitom12306"><img src="https://avatars.githubusercontent.com/u/125560621?v=4?s=100" width="100px;" alt="wangzitom12306"/><br /><sub><b>wangzitom12306</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awangzitom12306" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/winhkey"><img src="https://avatars.githubusercontent.com/u/4877808?v=4?s=100" width="100px;" alt="winhkey"/><br /><sub><b>winhkey</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awinhkey" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/witherspore"><img src="https://avatars.githubusercontent.com/u/813263?v=4?s=100" width="100px;" alt="witherspore"/><br /><sub><b>witherspore</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awitherspore" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wjljack"><img src="https://avatars.githubusercontent.com/u/1182478?v=4?s=100" width="100px;" alt="wjljack"/><br /><sub><b>wjljack</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awjljack" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wjljack"><img src="https://avatars.githubusercontent.com/u/1182478?v=4?s=100" width="100px;" alt="wjljack"/><br /><sub><b>wjljack</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awjljack" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wuchiuwong"><img src="https://avatars.githubusercontent.com/u/15967553?v=4?s=100" width="100px;" alt="wuchiuwong"/><br /><sub><b>wuchiuwong</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Awuchiuwong" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/songxing10000"><img src="https://avatars.githubusercontent.com/u/10040131?v=4?s=100" width="100px;" alt="xingsong"/><br /><sub><b>xingsong</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Asongxing10000" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xioayuge"><img src="https://avatars.githubusercontent.com/u/45328272?v=4?s=100" width="100px;" alt="xioayuge"/><br /><sub><b>xioayuge</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Axioayuge" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xnYi9wRezm"><img src="https://avatars.githubusercontent.com/u/61201892?v=4?s=100" width="100px;" alt="xnYi9wRezm"/><br /><sub><b>xnYi9wRezm</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=xnYi9wRezm" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3AxnYi9wRezm" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xuanuy"><img src="https://avatars.githubusercontent.com/u/3894777?v=4?s=100" width="100px;" alt="xuanuy"/><br /><sub><b>xuanuy</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Axuanuy" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xyf0921"><img src="https://avatars.githubusercontent.com/u/17350974?v=4?s=100" width="100px;" alt="xyf0921"/><br /><sub><b>xyf0921</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Axyf0921" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yalechen-cyw3"><img src="https://avatars.githubusercontent.com/u/34886223?v=4?s=100" width="100px;" alt="yalechen-cyw3"/><br /><sub><b>yalechen-cyw3</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ayalechen-cyw3" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yalechen-cyw3"><img src="https://avatars.githubusercontent.com/u/34886223?v=4?s=100" width="100px;" alt="yalechen-cyw3"/><br /><sub><b>yalechen-cyw3</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ayalechen-cyw3" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yasuharu-sato"><img src="https://avatars.githubusercontent.com/u/45546628?v=4?s=100" width="100px;" alt="yasuharu-sato"/><br /><sub><b>yasuharu-sato</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ayasuharu-sato" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zenglian"><img src="https://avatars.githubusercontent.com/u/5268434?v=4?s=100" width="100px;" alt="zenglian"/><br /><sub><b>zenglian</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Azenglian" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zgrzyt93"><img src="https://avatars.githubusercontent.com/u/54275965?v=4?s=100" width="100px;" alt="zgrzyt93"/><br /><sub><b>zgrzyt93</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=zgrzyt93" title="Code">💻</a> <a href="https://github.com/pmd/pmd/issues?q=author%3Azgrzyt93" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zhangxinngang"><img src="https://avatars.githubusercontent.com/u/6891146?v=4?s=100" width="100px;" alt="zh3ng"/><br /><sub><b>zh3ng</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Azhangxinngang" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yuchen1013"><img src="https://avatars.githubusercontent.com/u/17316917?v=4?s=100" width="100px;" alt="zt_soft"/><br /><sub><b>zt_soft</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Ayuchen1013" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ztt79"><img src="https://avatars.githubusercontent.com/u/48408552?v=4?s=100" width="100px;" alt="ztt79"/><br /><sub><b>ztt79</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aztt79" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zzzzfeng"><img src="https://avatars.githubusercontent.com/u/8851007?v=4?s=100" width="100px;" alt="zzzzfeng"/><br /><sub><b>zzzzfeng</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Azzzzfeng" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zzzzfeng"><img src="https://avatars.githubusercontent.com/u/8851007?v=4?s=100" width="100px;" alt="zzzzfeng"/><br /><sub><b>zzzzfeng</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Azzzzfeng" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/magwas"><img src="https://avatars.githubusercontent.com/u/756838?v=4?s=100" width="100px;" alt="Árpád Magosányi"/><br /><sub><b>Árpád Magosányi</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Amagwas" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/clsaa"><img src="https://avatars.githubusercontent.com/u/32028545?v=4?s=100" width="100px;" alt="任贵杰"/><br /><sub><b>任贵杰</b></sub></a><br /><a href="https://github.com/pmd/pmd/issues?q=author%3Aclsaa" title="Bug reports">🐛</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/341816041"><img src="https://avatars.githubusercontent.com/u/100549608?v=4?s=100" width="100px;" alt="茅延安"/><br /><sub><b>茅延安</b></sub></a><br /><a href="https://github.com/pmd/pmd/commits?author=341816041" title="Code">💻</a></td>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
---
|
||||
title: 3rd party rulesets
|
||||
# language_name is used by shuffle_panel in index.md
|
||||
language_name: 3rd party rulesets
|
||||
tags: [rule_references, userdocs]
|
||||
summary: Lists rulesets and rules from the community
|
||||
permalink: pmd_userdocs_3rdpartyrulesets.html
|
||||
|
||||
@@ -36,7 +36,7 @@ provided feedback and/or PRs!
|
||||
A detailed documentation of required changes are available in the [Migration Guide for PMD 7]({{ baseurl }}pmd_userdocs_migrating_to_pmd7.html).
|
||||
|
||||
{% if is_release_notes_processor %}
|
||||
<details>
|
||||
<details markdown="block" class="no-background">
|
||||
<summary markdown="span">Expand to see Release Notes
|
||||
</summary>
|
||||
{% endif %}
|
||||
@@ -248,7 +248,7 @@ The following previously deprecated rules have been finally removed:
|
||||
The following previously deprecated rulesets have been removed. These were the left-over rulesets from PMD 5.
|
||||
The rules have been moved into categories with PMD 6.
|
||||
|
||||
<details>
|
||||
<details markdown="block">
|
||||
<summary markdown="span">List of deprecated rulesets
|
||||
</summary>
|
||||
|
||||
@@ -357,6 +357,7 @@ The rules have been moved into categories with PMD 6.
|
||||
* [#4823](https://github.com/pmd/pmd/pull/4823): Update to use renamed pmd-designer
|
||||
* [#4827](https://github.com/pmd/pmd/pull/4827): \[compat6] Support config errors and cpd for csharp
|
||||
* [#4830](https://github.com/pmd/pmd/issues/4830): Consolidate packages in each maven module
|
||||
* [#4867](https://github.com/pmd/pmd/issues/4867): \[dist] ./mvnw command not found in dist-src
|
||||
* apex
|
||||
* [#3766](https://github.com/pmd/pmd/issues/3766): \[apex] Replace Jorje with fully open source front-end
|
||||
* [#4828](https://github.com/pmd/pmd/issues/4828): \[apex] Support null coalescing operator ?? (apex 60)
|
||||
@@ -767,8 +768,9 @@ full list of PRs.
|
||||
* Days since last release (6.55.0): 377
|
||||
* Days since last release (7.0.0-rc4): 160
|
||||
|
||||
{% endtocmaker %}
|
||||
|
||||
{% if is_release_notes_processor %}
|
||||
</details>
|
||||
{% endif %}
|
||||
|
||||
{% endtocmaker %}
|
||||
@@ -51,7 +51,7 @@ Contributors: [Clément Fournier](https://github.com/oowekyala) (@oowekyala),
|
||||
[Andreas Dangel](https://github.com/adangel) (@adangel),
|
||||
[Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod)
|
||||
|
||||
<div class="alert alert-info" role="alert"><i class="fas fa-info-circle"></i> <b>Note:</b>
|
||||
<div class="alert alert-info" role="alert" markdown="block"><i class="fas fa-info-circle"></i> <b>Note:</b>
|
||||
The full detailed documentation of the changes to the Java AST are available in the
|
||||
[Migration Guide for PMD 7](pmd_userdocs_migrating_to_pmd7.html#java-ast)
|
||||
</div>
|
||||
@@ -666,7 +666,7 @@ The rules have been moved into categories with PMD 6.
|
||||
|
||||
## 💥 Compatibility and Migration Notes
|
||||
|
||||
<div class="alert alert-info" role="alert"><i class="fas fa-info-circle"></i> <b>Note:</b>
|
||||
<div class="alert alert-info" role="alert" markdown="block"><i class="fas fa-info-circle"></i> <b>Note:</b>
|
||||
The full detailed documentation of the changes are available in the
|
||||
[Migration Guide for PMD 7](pmd_userdocs_migrating_to_pmd7.html)
|
||||
</div>
|
||||
@@ -3164,6 +3164,7 @@ No changes.
|
||||
* [#4823](https://github.com/pmd/pmd/pull/4823): Update to use renamed pmd-designer
|
||||
* [#4827](https://github.com/pmd/pmd/pull/4827): \[compat6] Support config errors and cpd for csharp
|
||||
* [#4830](https://github.com/pmd/pmd/issues/4830): Consolidate packages in each maven module
|
||||
* [#4867](https://github.com/pmd/pmd/issues/4867): \[dist] ./mvnw command not found in dist-src
|
||||
* ant
|
||||
* [#4080](https://github.com/pmd/pmd/issues/4080): \[ant] Split off Ant integration into a new submodule
|
||||
* core
|
||||
|
||||
@@ -8,11 +8,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.PMDVersion;
|
||||
import net.sourceforge.pmd.lang.document.FileLocation;
|
||||
import net.sourceforge.pmd.lang.rule.xpath.XPathRule;
|
||||
import net.sourceforge.pmd.lang.rule.xpath.XPathVersion;
|
||||
|
||||
class CodeClimateRendererTest extends AbstractRendererTest {
|
||||
private static final String VERSION_PART = PMDVersion.isUnknown() || PMDVersion.isSnapshot() ? "latest" : "pmd-doc-" + PMDVersion.VERSION;
|
||||
|
||||
@Override
|
||||
Renderer getRenderer() {
|
||||
@@ -26,7 +28,7 @@ class CodeClimateRendererTest extends AbstractRendererTest {
|
||||
+ "[Categories](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#categories): Style\\n\\n"
|
||||
+ "[Remediation Points](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#remediation-points): 50000\\n\\n"
|
||||
+ "Description with Unicode Character U+2013: – .\\n\\n"
|
||||
+ "### [PMD properties](https://docs.pmd-code.org/latest/pmd_userdocs_configuring_rules.html#rule-properties)\\n\\n"
|
||||
+ "### [PMD properties](https://docs.pmd-code.org/" + VERSION_PART + "/pmd_userdocs_configuring_rules.html#rule-properties)\\n\\n"
|
||||
+ "Name | Value | Description\\n" + "--- | --- | ---\\n"
|
||||
+ "violationSuppressRegex | | Suppress violations with messages matching a regular expression\\n"
|
||||
+ "violationSuppressXPath | | Suppress violations on nodes which match a given relative XPath expression.\\n"
|
||||
@@ -41,7 +43,7 @@ class CodeClimateRendererTest extends AbstractRendererTest {
|
||||
+ "[Categories](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#categories): Style\\n\\n"
|
||||
+ "[Remediation Points](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#remediation-points): 50000\\n\\n"
|
||||
+ "Description with Unicode Character U+2013: – .\\n\\n"
|
||||
+ "### [PMD properties](https://docs.pmd-code.org/latest/pmd_userdocs_configuring_rules.html#rule-properties)\\n\\n"
|
||||
+ "### [PMD properties](https://docs.pmd-code.org/" + VERSION_PART + "/pmd_userdocs_configuring_rules.html#rule-properties)\\n\\n"
|
||||
+ "Name | Value | Description\\n" + "--- | --- | ---\\n"
|
||||
+ "violationSuppressRegex | | Suppress violations with messages matching a regular expression\\n"
|
||||
+ "violationSuppressXPath | | Suppress violations on nodes which match a given relative XPath expression.\\n"
|
||||
@@ -63,7 +65,7 @@ class CodeClimateRendererTest extends AbstractRendererTest {
|
||||
+ "[Categories](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#categories): Style\\n\\n"
|
||||
+ "[Remediation Points](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#remediation-points): 50000\\n\\n"
|
||||
+ "Description with Unicode Character U+2013: – .\\n\\n"
|
||||
+ "### [PMD properties](https://docs.pmd-code.org/latest/pmd_userdocs_configuring_rules.html#rule-properties)\\n\\n"
|
||||
+ "### [PMD properties](https://docs.pmd-code.org/" + VERSION_PART + "/pmd_userdocs_configuring_rules.html#rule-properties)\\n\\n"
|
||||
+ "Name | Value | Description\\n" + "--- | --- | ---\\n"
|
||||
+ "violationSuppressRegex | | Suppress violations with messages matching a regular expression\\n"
|
||||
+ "violationSuppressXPath | | Suppress violations on nodes which match a given relative XPath expression.\\n"
|
||||
@@ -73,7 +75,7 @@ class CodeClimateRendererTest extends AbstractRendererTest {
|
||||
+ "[Categories](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#categories): Style\\n\\n"
|
||||
+ "[Remediation Points](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#remediation-points): 50000\\n\\n"
|
||||
+ "desc\\n\\n"
|
||||
+ "### [PMD properties](https://docs.pmd-code.org/latest/pmd_userdocs_configuring_rules.html#rule-properties)\\n\\n"
|
||||
+ "### [PMD properties](https://docs.pmd-code.org/" + VERSION_PART + "/pmd_userdocs_configuring_rules.html#rule-properties)\\n\\n"
|
||||
+ "Name | Value | Description\\n" + "--- | --- | ---\\n"
|
||||
+ "violationSuppressRegex | | Suppress violations with messages matching a regular expression\\n"
|
||||
+ "violationSuppressXPath | | Suppress violations on nodes which match a given relative XPath expression.\\n"
|
||||
|
||||
@@ -10,11 +10,22 @@
|
||||
<baseDirectory>pmd-src-${project.version}</baseDirectory>
|
||||
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<useDefaultExcludes>false</useDefaultExcludes>
|
||||
<directory>${project.basedir}/..</directory>
|
||||
<outputDirectory></outputDirectory>
|
||||
<includes>
|
||||
<include>mvnw</include>
|
||||
</includes>
|
||||
<fileMode>0755</fileMode>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<useDefaultExcludes>false</useDefaultExcludes>
|
||||
<directory>${project.basedir}/..</directory>
|
||||
<outputDirectory></outputDirectory>
|
||||
<excludes>
|
||||
<exclude>mvnw</exclude> <!-- added already above -->
|
||||
<exclude>.git/**</exclude>
|
||||
<exclude>**/target/**</exclude>
|
||||
<exclude>**/bin/**</exclude>
|
||||
@@ -40,6 +51,7 @@
|
||||
<exclude>docs/.bundle/**</exclude>
|
||||
<exclude>docs/vendor/**</exclude>
|
||||
<exclude>docs/_site/**</exclude>
|
||||
<exclude>node_modules/**</exclude>
|
||||
|
||||
<exclude>pmd-core/dependency-reduced-pom.xml</exclude>
|
||||
</excludes>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
package net.sourceforge.pmd.dist;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
@@ -12,6 +13,8 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
||||
import org.apache.commons.compress.archivers.zip.ZipFile;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.sourceforge.pmd.PMDVersion;
|
||||
@@ -28,6 +31,14 @@ class SourceDistributionIT {
|
||||
assertTrue(getSourceDistribution().exists());
|
||||
}
|
||||
|
||||
@Test
|
||||
void mavenWrapperShouldBeExecutable() throws Exception {
|
||||
try (ZipFile zip = ZipFile.builder().setFile(getSourceDistribution()).get()) {
|
||||
ZipArchiveEntry mavenWrapper = zip.getEntry(BASE_PATH + "/mvnw");
|
||||
assertEquals(ZipFileExtractor.OWNER_EXECUTABLE, mavenWrapper.getUnixMode() & ZipFileExtractor.OWNER_EXECUTABLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void verifyExclusions() throws Exception {
|
||||
Set<String> exclusions = new HashSet<>();
|
||||
@@ -35,6 +46,7 @@ class SourceDistributionIT {
|
||||
exclusions.add(BASE_PATH + "/.ci/files/private-env");
|
||||
exclusions.add(BASE_PATH + "/.ci/files/public-env");
|
||||
exclusions.add(BASE_PATH + "/.ci/files/release-signing-key-D0BF1D737C9A1C22.gpg.gpg");
|
||||
exclusions.add(BASE_PATH + "/node_modules/.bin/all-contributors");
|
||||
List<String> files = ZipFileExtractor.readZipFile(getSourceDistribution().toPath());
|
||||
|
||||
for (String file : files) {
|
||||
|
||||
@@ -7,9 +7,9 @@ package net.sourceforge.pmd.dist;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
@@ -27,7 +27,7 @@ import net.sourceforge.pmd.internal.util.IOUtil;
|
||||
*/
|
||||
public class ZipFileExtractor {
|
||||
// unix file permission for executable flag by owner
|
||||
private static final int OWNER_EXECUTABLE = 0x40;
|
||||
static final int OWNER_EXECUTABLE = 0x40;
|
||||
|
||||
private ZipFileExtractor() {
|
||||
// Helper class
|
||||
@@ -40,7 +40,7 @@ public class ZipFileExtractor {
|
||||
* @throws Exception if any error happens during extraction
|
||||
*/
|
||||
public static void extractZipFile(Path zipPath, Path tempDir) throws Exception {
|
||||
try (ZipFile zip = new ZipFile(zipPath.toFile())) {
|
||||
try (ZipFile zip = ZipFile.builder().setFile(zipPath.toFile()).get()) {
|
||||
Enumeration<ZipArchiveEntry> entries = zip.getEntries();
|
||||
while (entries.hasMoreElements()) {
|
||||
ZipArchiveEntry entry = entries.nextElement();
|
||||
@@ -49,11 +49,11 @@ public class ZipFileExtractor {
|
||||
assertTrue(file.mkdirs());
|
||||
} else {
|
||||
try (InputStream data = zip.getInputStream(entry);
|
||||
OutputStream fileOut = new FileOutputStream(file);) {
|
||||
OutputStream fileOut = Files.newOutputStream(file.toPath());) {
|
||||
IOUtil.copy(data, fileOut);
|
||||
}
|
||||
if ((entry.getUnixMode() & OWNER_EXECUTABLE) == OWNER_EXECUTABLE) {
|
||||
file.setExecutable(true);
|
||||
assertTrue(file.setExecutable(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class ZipFileExtractor {
|
||||
*/
|
||||
public static List<String> readZipFile(Path zipPath) throws Exception {
|
||||
List<String> result = new ArrayList<>();
|
||||
try (ZipFile zip = new ZipFile(zipPath.toFile())) {
|
||||
try (ZipFile zip = ZipFile.builder().setFile(zipPath.toFile()).get()) {
|
||||
Enumeration<ZipArchiveEntry> entries = zip.getEntries();
|
||||
while (entries.hasMoreElements()) {
|
||||
ZipArchiveEntry entry = entries.nextElement();
|
||||
|
||||
+17
@@ -789,4 +789,21 @@ public class CustomAssertTests {
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>#4114 FN @ParameterizedTest are tests too</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<code><![CDATA[
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
class ShouldIncludeAssertTest {
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = { "racecar", "radar", "Foobar" })
|
||||
void falseNegative(String candidate) {
|
||||
// Nothing!
|
||||
}
|
||||
}
|
||||
|
||||
]]></code>
|
||||
</test-code>
|
||||
</test-data>
|
||||
+52
@@ -476,4 +476,56 @@ public class Foo {
|
||||
<code-ref id="generic-anon-class"/>
|
||||
<source-type>java 17</source-type>
|
||||
</test-code>
|
||||
<test-code>
|
||||
<description>Issue #3353 - FNs in PMD 6</description>
|
||||
<expected-problems>3</expected-problems>
|
||||
<expected-messages>
|
||||
<message>Explicit type arguments can be replaced by a diamond: `new ArrayList<>()`</message>
|
||||
<message>Explicit type arguments can be replaced by a diamond: `new ArrayList<>(timestamps)`</message>
|
||||
<message>Explicit type arguments can be replaced by a diamond: `new MyConsumer<>()`</message>
|
||||
</expected-messages>
|
||||
<code><![CDATA[
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class DiamondIssues {
|
||||
|
||||
public static void main(final String[] args) {
|
||||
// <String> is not necessary. IntelliJ does not catch this one either
|
||||
doStuff(new ArrayList<String>());
|
||||
|
||||
// specifying <Date> is also not necessary. IntelliJ does not catch this one either
|
||||
final List<Timestamp> timestamps = Arrays.asList(new Timestamp(new Date().getTime()));
|
||||
doOtherStuff(new ArrayList<Date>(timestamps));
|
||||
|
||||
// <Integer> is not required. IntelliJ correctly reports this one as un-necessary
|
||||
addConsumer(Integer.class, new MyConsumer<Integer>());
|
||||
}
|
||||
|
||||
private static void doStuff(final Object object) {
|
||||
System.out.println(object);
|
||||
}
|
||||
|
||||
private static void doOtherStuff(final List<? extends Date> dates) {
|
||||
System.out.println(dates);
|
||||
}
|
||||
|
||||
private static <T> void addConsumer(final Class<? extends T> type, final Consumer<T> consumer) {
|
||||
// do something useful here
|
||||
}
|
||||
|
||||
private static class MyConsumer<T extends Number> implements Consumer<T> {
|
||||
|
||||
@Override
|
||||
public void accept(final T t) {
|
||||
System.out.println(t);
|
||||
}
|
||||
}
|
||||
}]]>
|
||||
</code>
|
||||
</test-code>
|
||||
</test-data>
|
||||
+33
@@ -901,4 +901,37 @@ interface Listener {
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
<test-code>
|
||||
<description> [java] SingularField false positive with non static inner classes #1688 </description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
class A {
|
||||
|
||||
private String value;
|
||||
private String derivedValue;
|
||||
|
||||
public A(String value) {
|
||||
this.value = value;
|
||||
this.derivedValue = this.value + "-more";
|
||||
}
|
||||
|
||||
private void run() {
|
||||
final B b = new B();
|
||||
b.useA();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new A("").run();
|
||||
}
|
||||
|
||||
public class B {
|
||||
|
||||
public void useA() {
|
||||
final String field = A.this.value;
|
||||
System.out.println(field);
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
</test-data>
|
||||
@@ -113,7 +113,7 @@
|
||||
<argLine>-Xmx512m -Dfile.encoding=${project.build.sourceEncoding} ${extraArgLine}</argLine>
|
||||
<extraArgLine /> <!-- empty by default, profiles set it as needed -->
|
||||
|
||||
<pmd.build-tools.version>23-SNAPSHOT</pmd.build-tools.version>
|
||||
<pmd.build-tools.version>23</pmd.build-tools.version>
|
||||
|
||||
<pmd-designer.version>7.0.0-SNAPSHOT</pmd-designer.version>
|
||||
<javacc.jar>${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar</javacc.jar>
|
||||
|
||||
Reference in new issue
Block a user