Merge branch 'master' into pr-4470

This commit is contained in:
Andreas Dangel
2023-05-19 09:46:16 +02:00
263 changed files with 7812 additions and 2976 deletions

View File

@ -7145,6 +7145,34 @@
"bug",
"code"
]
},
{
"login": "nwcm",
"name": "nwcm",
"avatar_url": "https://avatars.githubusercontent.com/u/111259588?v=4",
"profile": "https://github.com/nwcm",
"contributions": [
"doc"
]
},
{
"login": "PimvanderLoos",
"name": "Pim van der Loos",
"avatar_url": "https://avatars.githubusercontent.com/u/3114723?v=4",
"profile": "https://github.com/PimvanderLoos",
"contributions": [
"code",
"test"
]
},
{
"login": "joaodinissf",
"name": "João Dinis Ferreira",
"avatar_url": "https://avatars.githubusercontent.com/u/6786818?v=4",
"profile": "https://github.com/joaodinissf",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,

View File

@ -138,7 +138,7 @@ f=check-environment.sh; \
Calling `.ci/build.sh` directly would re-release the tag $TAG_NAME - that's why it is commented out.
All the side-effects of a release would be carried out like creating and publishing a release on github,
uploading the release to sourceforge, uploading the docs to pmd.github.io/docs.pmd-code.org, uploading a
uploading the release to sourceforge, uploading the docs to docs.pmd-code.org, uploading a
new baseline for the regression tester and so on. While the release should be reproducible and therefore should
produce exactly the same artifacts, re-uploading artifacts is not desired just for testing.

View File

@ -55,6 +55,13 @@ function build() {
# stop early for invalid maven version and branch/tag combination
pmd_ci_maven_verify_version || exit 0
# skip tests when doing a release build - this makes the process faster
# it's a manual task now to verify that a release is only started, when the main branch
# was green before. This is usually checked via a local build, see ./do-release.sh
if pmd_ci_maven_isReleaseBuild; then
PMD_MAVEN_EXTRA_OPTS+=(-DskipTests=true)
fi
if [ "$(pmd_ci_utils_get_os)" != "linux" ]; then
pmd_ci_log_group_start "Build with mvnw"
./mvnw clean verify --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}"
@ -179,6 +186,11 @@ function pmd_ci_deploy_build_artifacts() {
# Deploy to sourceforge files https://sourceforge.net/projects/pmd/files/pmd/
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-bin-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-src-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
# Deploy SBOM
cp pmd-dist/target/bom.xml "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml"
cp pmd-dist/target/bom.json "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json"
if pmd_ci_maven_isReleaseBuild; then
# create a draft github release
@ -188,6 +200,9 @@ function pmd_ci_deploy_build_artifacts() {
# Deploy to github releases
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-bin-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-src-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
# Deploy SBOM
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml"
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json"
fi
}
@ -224,7 +239,7 @@ function pmd_ci_build_and_upload_doc() {
pmd_ci_sourceforge_uploadReleaseNotes "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "${rendered_release_notes}"
if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "master" ]; then
# only for snapshot builds from branch master
# only for snapshot builds from branch master: https://docs.pmd-code.org/snapshot -> pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}
pmd_code_createSymlink "${PMD_CI_MAVEN_PROJECT_VERSION}" "snapshot"
# update github pages https://pmd.github.io/pmd/
@ -249,14 +264,12 @@ function pmd_ci_build_and_upload_doc() {
local rendered_release_notes_with_links
rendered_release_notes_with_links="
* Downloads: https://github.com/pmd/pmd/releases/tag/pmd_releases%2F${PMD_CI_MAVEN_PROJECT_VERSION}
* Documentation: https://pmd.github.io/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}/
* Documentation: https://docs.pmd-code.org/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/
${rendered_release_notes}"
pmd_ci_sourceforge_createDraftBlogPost "${release_name} released" "${rendered_release_notes_with_links}" "pmd,release"
SF_BLOG_URL="${RESULT}"
# updates https://pmd.github.io/latest/ and https://pmd.github.io/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}
publish_release_documentation_github
# rsync site to https://pmd.sourceforge.io/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}
pmd_ci_sourceforge_rsyncSnapshotDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-${PMD_CI_MAVEN_PROJECT_VERSION}"
fi

View File

@ -42,55 +42,7 @@ function pmd_doc_create_archive() {
}
#
# Publishes the site to https://pmd.github.io/pmd-${PMD_CI_MAVEN_PROJECT_VERSION} and
# https://pmd.github.io/latest/
#
function publish_release_documentation_github() {
echo -e "\n\n"
pmd_ci_log_info "Adding the new doc to pmd.github.io..."
# clone pmd.github.io. Note: This uses the ssh key setup earlier
# In order to speed things up, we use a sparse checkout - no need to checkout all directories here
mkdir pmd.github.io
(
cd pmd.github.io || { echo "Directory 'pmd.github.io' doesn't exist"; exit 1; }
git init
git config user.name "PMD CI (pmd-bot)"
git config user.email "pmd-bot@users.noreply.github.com"
git config core.sparsecheckout true
git remote add origin git@github.com-pmd.github.io:pmd/pmd.github.io.git
echo "/latest/" > .git/info/sparse-checkout
echo "/sitemap.xml" >> .git/info/sparse-checkout
git pull --depth=1 origin master
pmd_ci_log_info "Copying documentation from ../docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/ to pmd-${PMD_CI_MAVEN_PROJECT_VERSION}/ ..."
rsync -ah --stats "../docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/" "pmd-${PMD_CI_MAVEN_PROJECT_VERSION}/"
git status
pmd_ci_log_debug "Executing: git add pmd-${PMD_CI_MAVEN_PROJECT_VERSION}"
git add --sparse "pmd-${PMD_CI_MAVEN_PROJECT_VERSION}"
pmd_ci_log_debug "Executing: git commit..."
git commit -q -m "Added pmd-${PMD_CI_MAVEN_PROJECT_VERSION}"
pmd_ci_log_info "Copying pmd-${PMD_CI_MAVEN_PROJECT_VERSION} to latest ..."
git rm -qr latest
cp -a "pmd-${PMD_CI_MAVEN_PROJECT_VERSION}" latest
pmd_ci_log_debug "Executing: git add latest"
git add latest
pmd_ci_log_debug "Executing: git commit..."
git commit -q -m "Copying pmd-${PMD_CI_MAVEN_PROJECT_VERSION} to latest"
pmd_ci_log_info "Generating sitemap.xml"
../docs/sitemap_generator.sh > sitemap.xml
pmd_ci_log_debug "Executing: git add sitemap.xml"
git add sitemap.xml
pmd_ci_log_debug "Executing: git commit..."
git commit -q -m "Generated sitemap.xml"
pmd_ci_log_info "Executing: git push origin master"
git push origin master
)
}
#
# Updates github pages of the main repository,
# Updates github pages branch "gh-pages" of the main repository,
# so that https://pmd.github.io/pmd/ has the latest (snapshot) content
#
function pmd_doc_publish_to_github_pages() {

View File

@ -13,7 +13,7 @@ assignees: ''
**Rule:**
Please provide the rule name and a link to the rule documentation:
<https://pmd.github.io/latest/pmd_rules_XXX_XXX.html#XXX>
<https://docs.pmd-code.org/latest/pmd_rules_XXX_XXX.html#XXX>
**Description:**

View File

@ -13,7 +13,7 @@ assignees: ''
**Rule:**
Please provide the rule name and a link to the rule documentation:
<https://pmd.github.io/latest/pmd_rules_XXX_XXX.html#XXX>
<https://docs.pmd-code.org/latest/pmd_rules_XXX_XXX.html#XXX>
**Description:**

View File

@ -33,11 +33,11 @@ When filing a bug report, please provide as much information as possible, so tha
## Documentation
There is some documentation available under <https://pmd.github.io/latest>. Feel free to create a bug report if
There is some documentation available under <https://docs.pmd-code.org/latest>. Feel free to create a bug report if
documentation is missing, incomplete or outdated. See [Bug reports](#bug-reports).
The documentation is generated as a Jekyll site, the source is available at: <https://github.com/pmd/pmd/tree/master/docs>. You can find build instructions there.
For more on contributing documentation check <https://pmd.github.io/pmd/pmd_devdocs_writing_documentation.html>
For more on contributing documentation check <https://docs.pmd-code.org/latest/pmd_devdocs_writing_documentation.html>
## Questions

View File

@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
claide (1.1.0)
claide-plugins (0.9.2)
@ -31,13 +31,13 @@ GEM
faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-http-cache (2.4.1)
faraday-http-cache (2.5.0)
faraday (>= 0.8)
faraday-net_http (3.0.2)
fugit (1.8.1)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
git (1.17.2)
git (1.18.0)
addressable (~> 2.8)
rchardet (~> 1.8)
kramdown (2.4.0)
@ -49,7 +49,7 @@ GEM
mini_portile2 (2.8.1)
nap (1.1.0)
no_proxy_fix (0.1.2)
nokogiri (1.14.2)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
octokit (5.6.1)

View File

@ -9,7 +9,7 @@
[![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg)](https://coveralls.io/github/pmd/pmd)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ea550046a02344ec850553476c4aa2ca)](https://www.codacy.com/gh/pmd/pmd/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=pmd/pmd&amp;utm_campaign=Badge_Grade)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)
[![Documentation (latest)](https://img.shields.io/badge/docs-latest-green)](https://pmd.github.io/latest/)
[![Documentation (latest)](https://img.shields.io/badge/docs-latest-green)](https://docs.pmd-code.org/latest/)
**PMD** is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks,
unnecessary object creation, and so forth. It supports many languages. It can be extended with custom rules.
@ -32,9 +32,9 @@ it makes sense.
Download the latest binary zip from the [releases](https://github.com/pmd/pmd/releases/latest)
and extract it somewhere.
Execute `bin/run.sh pmd` or `bin\pmd.bat`.
Execute `bin/pmd check` or `bin\pmd.bat check`.
See also [Getting Started](https://pmd.github.io/latest/pmd_userdocs_installation.html)
See also [Getting Started](https://docs.pmd-code.org/latest/pmd_userdocs_installation.html)
**Demo:**
@ -43,7 +43,7 @@ This shows how PMD can detect for loops, that can be replaced by for-each loops.
![Demo](docs/images/userdocs/pmd-demo.gif)
There are plugins for Maven and Gradle as well as for various IDEs.
See [Tools / Integrations](https://pmd.github.io/latest/pmd_userdocs_tools.html)
See [Tools / Integrations](https://docs.pmd-code.org/latest/pmd_userdocs_tools.html)
## How to get support?
@ -54,7 +54,7 @@ See [Tools / Integrations](https://pmd.github.io/latest/pmd_userdocs_tools.html)
* I got this error and I'm sure it's a bug -- file an [issue](https://github.com/pmd/pmd/issues).
* I have an idea/request/question -- create a new [discussion](https://github.com/pmd/pmd/discussions).
* I have a quick question -- ask in our [Gitter room](https://app.gitter.im/#/room/#pmd_pmd:gitter.im).
* Where's your documentation? -- <https://pmd.github.io/latest/>
* Where's your documentation? -- <https://docs.pmd-code.org/latest/>
## 🤝 Contributing

View File

@ -165,26 +165,13 @@ git commit -a -m "Prepare pmd release ${RELEASE_VERSION}"
fi
)
# for release candidates, allow snapshot dependencies
if [[ "${RELEASE_VERSION}" == *-rc* ]]; then
./mvnw versions:set -DnewVersion="${RELEASE_VERSION}" -DgenerateBackupPoms=false
git commit -S -a -m "[release] prepare release pmd_releases/${RELEASE_VERSION}"
git tag -a -s -m "[release] tag pmd_releases/${RELEASE_VERSION}" "pmd_releases/${RELEASE_VERSION}"
# test build
./mvnw clean verify -Denforcer.skip=true
./mvnw versions:set -DnewVersion="${DEVELOPMENT_VERSION}" -DgenerateBackupPoms=false
git commit -S -a -m "[release] prepare for next development iteration"
# push
git push origin
git push origin tag "pmd_releases/${RELEASE_VERSION}"
else
./mvnw -B release:clean release:prepare \
./mvnw -B release:clean release:prepare \
-Dtag="pmd_releases/${RELEASE_VERSION}" \
-DreleaseVersion="${RELEASE_VERSION}" \
-DdevelopmentVersion="${DEVELOPMENT_VERSION}" \
-DscmCommentPrefix="[release] " \
-Pgenerate-rule-docs
fi
echo
echo "Tag has been pushed.... now check github actions: <https://github.com/pmd/pmd/actions>"

View File

@ -6,17 +6,17 @@ GEM
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.1)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
commonmarker (0.23.8)
commonmarker (0.23.9)
concurrent-ruby (1.2.2)
dnsruby (1.61.9)
simpleidn (~> 0.1)
dnsruby (1.70.0)
simpleidn (~> 0.2.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
@ -86,7 +86,7 @@ GEM
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (1.12.0)
i18n (1.13.0)
concurrent-ruby (~> 1.0)
jekyll (3.9.3)
addressable (~> 2.4)
@ -211,7 +211,7 @@ GEM
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.18.0)
nokogiri (1.14.2)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
octokit (4.25.1)

View File

@ -1,8 +1,10 @@
# PMD Documentation
The documentation is available at: <https://pmd.github.io/pmd/>
The snapshot documentation (build by github pages) is available at: <https://pmd.github.io/pmd/>.
The documentation for the latest release is at: <https://pmd.github.io/latest/>
The same documentation (build with our own scripts) is available at: <https://docs.pmd-code.org/snapshot/>.
The documentation for the latest release is at: <https://docs.pmd-code.org/latest/>
## Site Theme

View File

@ -3,7 +3,7 @@ repository: pmd/pmd
pmd:
version: 7.0.0-SNAPSHOT
previous_version: 6.55.0
date: ??-????-2023
date: 27-May-2023
release_type: major
# release types: major, minor, bugfix
@ -44,7 +44,6 @@ exclude:
- pdf-*.sh
- pdfconfigs/
- pdf/
- sitemap_generator.sh
- render_release_notes.rb
feedback_subject_line: PMD Source Code Analyzer
@ -117,7 +116,7 @@ description: "Intended as a documentation theme based on Jekyll for technical wr
# the description is used in the feed.xml file
# needed for sitemap.xml file only
url: https://pmd.github.io/pmd
url: https://docs.pmd-code.org/latest
baseurl: ""
# used by javadoc_tag.rb

View File

@ -409,6 +409,9 @@ entries:
- title: Java
url: /pmd_languages_java.html
output: web, pdf
- title: JavaScript / TypeScript
url: /pmd_languages_js_ts.html
output: web, pdf
- title: JSP
url: /pmd_languages_jsp.html
output: web, pdf
@ -430,6 +433,12 @@ entries:
- title: Gherkin
url: /pmd_languages_gherkin.html
output: web, pdf
- title: Julia
url: /pmd_languages_julia.html
output: web, pdf
- title: Coco
url: /pmd_languages_coco.html
output: web, pdf
- title: Developer Documentation
output: web, pdf
folderitems:
@ -469,7 +478,7 @@ entries:
- title: Adding a new language (JavaCC)
url: /pmd_devdocs_major_adding_new_language_javacc.html
output: web, pdf
- title: Adding a new language (Antlr)
- title: Adding a new language (ANTLR)
url: /pmd_devdocs_major_adding_new_language_antlr.html
output: web, pdf
- title: Adding a new CPD language

View File

@ -9,7 +9,7 @@
target="_blank"
href="https://github.com/{{site.github_editme_path}}{{editmepath}}"
role="button"
><i class="fa fa-github fa-lg"></i> Edit on GitHub</a
><i class="fab fa-github fa-lg"></i> Edit on GitHub</a
>
</div>
{% endif %}

View File

@ -6,7 +6,7 @@
<title>{{ page.title }} | {{ site.site_title }}</title>
<link rel="stylesheet" type="text/css" href="assets/fontawesome-free-5.14.0-web/css/all.min.css">
<link rel="stylesheet" type="text/css" href="assets/fontawesome-free-5.15.4-web/css/all.min.css">
<link rel="stylesheet" type="text/css" href="assets/bootstrap-4.5.2-dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/syntax.css">
@ -15,7 +15,7 @@
<link rel="stylesheet" type="text/css" href="css/theme-green.css">
<link rel="stylesheet" type="text/css" href="css/pmd-customstyles.css">
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="images/logo/favicon.ico" type="image/x-icon">
<link rel="icon" href="images/logo/favicon.ico" type="image/x-icon">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="feed.xml">

View File

@ -53,7 +53,7 @@ class RuleTag < Liquid::Tag
# This is passed from the release notes processing script
# When generating links for the release notes, the links should be absolute
if context["is_release_notes_processor"]
url_prefix = "https://pmd.github.io/pmd-#{context["site.pmd.version"]}/"
url_prefix = "https://docs.pmd-code.org/pmd-doc-#{context["site.pmd.version"]}/"
end
if @was_removed

View File

@ -4,7 +4,7 @@
Doc: https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself
Download: https://use.fontawesome.com/releases/v5.14.0/fontawesome-free-5.14.0-web.zip
Download: https://use.fontawesome.com/releases/v5.15.4/fontawesome-free-5.15.4-web.zip
## Bootstrap

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More