diff --git a/.all-contributorsrc b/.all-contributorsrc index e4cd253c2b..41116fe796 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -3267,7 +3267,8 @@ "avatar_url": "https://avatars.githubusercontent.com/u/24591067?v=4", "profile": "https://github.com/jborgers", "contributions": [ - "bug" + "bug", + "code" ] }, { @@ -3384,7 +3385,8 @@ "avatar_url": "https://avatars.githubusercontent.com/u/242337?v=4", "profile": "https://github.com/jjlharrison", "contributions": [ - "bug" + "bug", + "code" ] }, { @@ -6584,6 +6586,178 @@ "contributions": [ "code" ] + }, + { + "login": "jasonqiu98", + "name": "Jason Qiu", + "avatar_url": "https://avatars.githubusercontent.com/u/26801257?v=4", + "profile": "https://github.com/jasonqiu98", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "laoseth", + "name": "Seth Wilcox", + "avatar_url": "https://avatars.githubusercontent.com/u/16923065?v=4", + "profile": "https://github.com/laoseth", + "contributions": [ + "code" + ] + }, + { + "login": "LiGaOg", + "name": "LiGaOg", + "avatar_url": "https://avatars.githubusercontent.com/u/72175888?v=4", + "profile": "https://github.com/LiGaOg", + "contributions": [ + "code" + ] + }, + { + "login": "Scrsloota", + "name": "Scrsloota", + "avatar_url": "https://avatars.githubusercontent.com/u/91131546?v=4", + "profile": "https://github.com/Scrsloota", + "contributions": [ + "code" + ] + }, + { + "login": "VoidxHoshi", + "name": "LaLucid", + "avatar_url": "https://avatars.githubusercontent.com/u/55886143?v=4", + "profile": "https://github.com/VoidxHoshi", + "contributions": [ + "code" + ] + }, + { + "login": "naveensrinivasan", + "name": "Naveen", + "avatar_url": "https://avatars.githubusercontent.com/u/172697?v=4", + "profile": "https://naveensrinivasan.dev/", + "contributions": [ + "code" + ] + }, + { + "login": "lukelukes", + "name": "lukelukes", + "avatar_url": "https://avatars.githubusercontent.com/u/45536418?v=4", + "profile": "https://github.com/lukelukes", + "contributions": [ + "code" + ] + }, + { + "login": "vibhory2j", + "name": "Vibhor Goyal", + "avatar_url": "https://avatars.githubusercontent.com/u/15845016?v=4", + "profile": "https://github.com/vibhory2j", + "contributions": [ + "bug" + ] + }, + { + "login": "Ramel0921", + "name": "Ramel0921", + "avatar_url": "https://avatars.githubusercontent.com/u/104978096?v=4", + "profile": "https://github.com/Ramel0921", + "contributions": [ + "bug" + ] + }, + { + "login": "flyhard", + "name": "Per Abich", + "avatar_url": "https://avatars.githubusercontent.com/u/409466?v=4", + "profile": "https://github.com/flyhard", + "contributions": [ + "code" + ] + }, + { + "login": "filipponova", + "name": "Filippo Nova", + "avatar_url": "https://avatars.githubusercontent.com/u/12506636?v=4", + "profile": "https://github.com/filipponova", + "contributions": [ + "bug" + ] + }, + { + "login": "dalizi007", + "name": "dalizi007", + "avatar_url": "https://avatars.githubusercontent.com/u/90743616?v=4", + "profile": "https://github.com/dalizi007", + "contributions": [ + "code" + ] + }, + { + "login": "shiomiyan", + "name": "shiomiyan", + "avatar_url": "https://avatars.githubusercontent.com/u/35842766?v=4", + "profile": "https://github.com/shiomiyan", + "contributions": [ + "doc" + ] + }, + { + "login": "lgemeinhardt", + "name": "lgemeinhardt", + "avatar_url": "https://avatars.githubusercontent.com/u/1395165?v=4", + "profile": "https://github.com/lgemeinhardt", + "contributions": [ + "bug" + ] + }, + { + "login": "HaelC", + "name": "Haoliang Chen", + "avatar_url": "https://avatars.githubusercontent.com/u/16898273?v=4", + "profile": "https://haelchan.me/", + "contributions": [ + "bug" + ] + }, + { + "login": "FSchliephacke", + "name": "FSchliephacke", + "avatar_url": "https://avatars.githubusercontent.com/u/10260493?v=4", + "profile": "https://github.com/FSchliephacke", + "contributions": [ + "bug" + ] + }, + { + "login": "stokpop", + "name": "Peter Paul Bakker", + "avatar_url": "https://avatars.githubusercontent.com/u/8797018?v=4", + "profile": "https://www.stokpop.nl/", + "contributions": [ + "code" + ] + }, + { + "login": "ASBrouwers", + "name": "ASBrouwers", + "avatar_url": "https://avatars.githubusercontent.com/u/23551289?v=4", + "profile": "https://github.com/ASBrouwers", + "contributions": [ + "code" + ] + }, + { + "login": "341816041", + "name": "茅延安", + "avatar_url": "https://avatars.githubusercontent.com/u/100549608?v=4", + "profile": "https://github.com/341816041", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/.ci/build.sh b/.ci/build.sh index ebacd1cf0c..828fcb9bbf 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -245,12 +245,15 @@ ${rendered_release_notes}" # Runs the dogfood ruleset with the currently built pmd against itself # function pmd_ci_dogfood() { + local mpmdVersion=() ./mvnw versions:set -DnewVersion="${PMD_CI_MAVEN_PROJECT_VERSION}-dogfood" -DgenerateBackupPoms=false sed -i 's/[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}.*<\/version>\( *\)/'"${PMD_CI_MAVEN_PROJECT_VERSION}"'<\/version>\1/' pom.xml if [ "${PMD_CI_MAVEN_PROJECT_VERSION}" = "7.0.0-SNAPSHOT" ]; then sed -i 's/pmd-dogfood-config\.xml/pmd-dogfood-config7.xml/' pom.xml + mpmdVersion=(-Denforcer.skip=true -Dpmd.plugin.version=3.18.0-pmd7-SNAPSHOT) fi ./mvnw verify --show-version --errors --batch-mode --no-transfer-progress "${PMD_MAVEN_EXTRA_OPTS[@]}" \ + "${mpmdVersion[@]}" \ -DskipTests \ -Dmaven.javadoc.skip=true \ -Dmaven.source.skip=true \ diff --git a/.ci/files/project-list.xml b/.ci/files/project-list.xml index f7cd9ffd5d..ce357698bc 100644 --- a/.ci/files/project-list.xml +++ b/.ci/files/project-list.xml @@ -1,7 +1,7 @@ + xsi:noNamespaceSchemaLocation="projectlist_1_1_0.xsd"> Standard Projects @@ -40,6 +40,11 @@ mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=classpath.t .*/build/generated-sources/.* classpath.txt ]]> @@ -151,23 +151,15 @@ fi Schedul-o-matic-9000 git - https://github.com/pmd/Schedul-o-matic-9000 - - pmd-regression-test + 6b1229ba43b38931fbbab5924bc9b9611d19a786 fflib-apex-common git - https://github.com/pmd/fflib-apex-common - - pmd-regression-test + 7e0891efb86d23de62811af56d87d0959082a322 diff --git a/.ci/git-repo-sync.sh b/.ci/git-repo-sync.sh index a32d6c9b03..af0635d9ba 100755 --- a/.ci/git-repo-sync.sh +++ b/.ci/git-repo-sync.sh @@ -27,7 +27,7 @@ function git_repo_sync() { pmd_ci_log_group_start "Git Sync" git remote add pmd-sf "${PMD_SF_USER}@git.code.sf.net:/p/pmd/code" if [ -n "${PMD_CI_BRANCH}" ]; then - git push pmd-sf "${PMD_CI_BRANCH}:${PMD_CI_BRANCH}" + retry 5 git push pmd-sf "${PMD_CI_BRANCH}:${PMD_CI_BRANCH}" pmd_ci_log_success "Successfully pushed ${PMD_CI_BRANCH} to sourceforge" elif [ -n "${PMD_CI_TAG}" ]; then git push pmd-sf tag "${PMD_CI_TAG}" @@ -39,6 +39,43 @@ function git_repo_sync() { pmd_ci_log_group_end } + +# +# From: https://gist.github.com/sj26/88e1c6584397bb7c13bd11108a579746 +# +# Retry a command up to a specific number of times until it exits successfully, +# with exponential back off. +# +# $ retry 5 echo Hello +# Hello +# +# $ retry 5 false +# Retry 1/5 exited 1, retrying in 1 seconds... +# Retry 2/5 exited 1, retrying in 2 seconds... +# Retry 3/5 exited 1, retrying in 4 seconds... +# Retry 4/5 exited 1, retrying in 8 seconds... +# Retry 5/5 exited 1, no more retries left. +# +function retry { + local retries=$1 + shift + + local count=0 + until "$@"; do + exit=$? + wait=$((2 ** $count)) + count=$(($count + 1)) + if [ $count -lt $retries ]; then + echo "Retry $count/$retries exited $exit, retrying in $wait seconds..." + sleep $wait + else + echo "Retry $count/$retries exited $exit, no more retries left." + return $exit + fi + done + return 0 +} + git_repo_sync exit 0 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6cc5ba69d6..01b91ce2d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 2 - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: | ~/.m2/repository @@ -46,7 +46,7 @@ jobs: run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/17/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/18/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/.github/workflows/git-repo-sync.yml b/.github/workflows/git-repo-sync.yml index 250dd00933..a990a6726b 100644 --- a/.github/workflows/git-repo-sync.yml +++ b/.github/workflows/git-repo-sync.yml @@ -22,7 +22,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/17/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/18/scripts" >> $GITHUB_ENV - name: Sync run: .ci/git-repo-sync.sh shell: bash diff --git a/.github/workflows/troubleshooting.yml b/.github/workflows/troubleshooting.yml index dc8f796c12..ea4bd54fd9 100644 --- a/.github/workflows/troubleshooting.yml +++ b/.github/workflows/troubleshooting.yml @@ -2,6 +2,9 @@ name: troubleshooting on: workflow_dispatch +permissions: + contents: read + jobs: build: runs-on: ${{ matrix.os }} @@ -13,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: | ~/.m2/repository @@ -33,7 +36,7 @@ jobs: run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/17/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/18/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index db95c131dd..25a1876bb8 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar diff --git a/Dangerfile b/Dangerfile index 735dc7d737..f0fd4eb8a5 100644 --- a/Dangerfile +++ b/Dangerfile @@ -42,7 +42,7 @@ def run_pmdtester @base_branch = 'master' @logger.info "\n\n--------------------------------------" @logger.info "Run against #{@base_branch}" - @summary = PmdTester::Runner.new(get_args(@base_branch)).run + @summary = PmdTester::Runner.new(get_args(@base_branch, FALSE, 'target/diff1/patch_config.xml')).run # move the generated report out of the way FileUtils.mv 'target/reports/diff', 'target/diff2' diff --git a/Gemfile.lock b/Gemfile.lock index 751d2e9be4..b41e9645e9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,7 +12,7 @@ GEM concurrent-ruby (1.1.10) cork (0.3.0) colored2 (~> 3.1) - danger (8.5.0) + danger (8.6.1) claide (~> 1.0) claide-plugins (>= 0.9.2) colored2 (~> 3.1) @@ -53,12 +53,12 @@ GEM faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.3) - fugit (1.5.2) - et-orbi (~> 1.1, >= 1.1.8) + fugit (1.5.3) + et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) - git (1.10.2) + git (1.11.0) rchardet (~> 1.8) - kramdown (2.3.2) + kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) @@ -68,21 +68,21 @@ GEM multipart-post (2.1.1) nap (1.1.0) no_proxy_fix (0.1.2) - nokogiri (1.13.3) + nokogiri (1.13.6) mini_portile2 (~> 2.8.0) racc (~> 1.4) octokit (4.22.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) open4 (1.3.4) - pmdtester (1.4.0) + pmdtester (1.5.1) differ (~> 0.1) liquid (~> 5.2) logger-colors (~> 1.0) nokogiri (~> 1.13) rufus-scheduler (~> 3.8) slop (~> 4.6) - public_suffix (4.0.6) + public_suffix (4.0.7) raabro (1.4.0) racc (1.6.0) rchardet (1.8.0) @@ -95,7 +95,7 @@ GEM sawyer (0.8.2) addressable (>= 2.3.5) faraday (> 0.8, < 2.0) - slop (4.9.1) + slop (4.9.2) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) tzinfo (2.0.4) diff --git a/antlr4-wrapper.xml b/antlr4-wrapper.xml index 2e4b617e27..c2d3e224ff 100644 --- a/antlr4-wrapper.xml +++ b/antlr4-wrapper.xml @@ -8,7 +8,7 @@ - lang-name: matches the grammar name (eg "Swift") - lang-terse-name: uncapitalized package name (eg "swift") - node-prefix: prefix for generated AST nodes (eg "Sw") - - root-node-name: name of the root node (eg "TopLevel"), will be made to implement RootNode + - root-node-name: name of the root node without prefix (eg "TopLevel"), will be made to implement RootNode See AntlrGeneratedParserBase @@ -31,9 +31,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -45,7 +81,7 @@ - + diff --git a/do-release.sh b/do-release.sh index 5cd900bf32..3ddb331bbd 100755 --- a/do-release.sh +++ b/do-release.sh @@ -72,6 +72,14 @@ export RELEASE_VERSION export DEVELOPMENT_VERSION export CURRENT_BRANCH +# check for SNAPSHOT version of pmd.build-tools.version +BUILD_TOOLS_VERSION=$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=pmd.build-tools.version -q -DforceStdout) +BUILD_TOOLS_VERSION_RELEASE=${BUILD_TOOLS_VERSION%-SNAPSHOT} +if [ "${BUILD_TOOLS_VERSION}" != "${BUILD_TOOLS_VERSION_RELEASE}" ]; then + echo "Error: version pmd.build-tools.version is ${BUILD_TOOLS_VERSION} - snapshot is not allowed" + exit 1 +fi + RELEASE_RULESET="pmd-core/src/main/resources/rulesets/releases/${RELEASE_VERSION//\./}.xml" echo "* Update date info in **docs/_config.yml**." diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 48cf85a1d9..af044ad8d5 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.4.7) + activesupport (6.0.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -15,7 +15,7 @@ GEM coffee-script-source (1.11.1) colorator (1.1.0) commonmarker (0.23.4) - concurrent-ruby (1.1.9) + concurrent-ruby (1.1.10) dnsruby (1.61.9) simpleidn (~> 0.1) em-websocket (0.5.3) @@ -51,9 +51,9 @@ GEM ffi (1.15.5) forwardable-extended (2.6.0) gemoji (3.0.1) - github-pages (225) + github-pages (226) github-pages-health-check (= 1.17.9) - jekyll (= 3.9.0) + jekyll (= 3.9.2) jekyll-avatar (= 0.7.0) jekyll-coffeescript (= 1.1.1) jekyll-commonmark-ghpages (= 0.2.0) @@ -88,12 +88,12 @@ GEM jekyll-theme-time-machine (= 0.2.0) jekyll-titles-from-headings (= 0.5.3) jemoji (= 0.12.0) - kramdown (= 2.3.1) + kramdown (= 2.3.2) kramdown-parser-gfm (= 1.1.0) liquid (= 4.0.3) mercenary (~> 0.3) minima (= 2.5.1) - nokogiri (>= 1.12.5, < 2.0) + nokogiri (>= 1.13.4, < 2.0) rouge (= 3.26.0) terminal-table (~> 1.4) github-pages-health-check (1.17.9) @@ -102,13 +102,13 @@ GEM octokit (~> 4.0) public_suffix (>= 3.0, < 5.0) typhoeus (~> 1.3) - html-pipeline (2.14.0) + html-pipeline (2.14.1) activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.8.0) i18n (0.9.5) concurrent-ruby (~> 1.0) - jekyll (3.9.0) + jekyll (3.9.2) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) @@ -216,7 +216,7 @@ GEM gemoji (~> 3.0) html-pipeline (~> 2.2) jekyll (>= 3.0, < 5.0) - kramdown (2.3.1) + kramdown (2.3.2) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) @@ -232,7 +232,7 @@ GEM jekyll-seo-tag (~> 2.1) minitest (5.15.0) multipart-post (2.1.1) - nokogiri (1.13.3) + nokogiri (1.13.6) mini_portile2 (~> 2.8.0) racc (~> 1.4) octokit (4.22.0) @@ -240,7 +240,7 @@ GEM sawyer (~> 0.8.0, >= 0.5.3) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.6) + public_suffix (4.0.7) racc (1.6.0) rb-fsevent (0.11.1) rb-inotify (0.10.1) @@ -269,7 +269,7 @@ GEM thread_safe (~> 0.1) unf (0.1.4) unf_ext - unf_ext (0.0.8) + unf_ext (0.0.8.1) unicode-display_width (1.8.0) zeitwerk (2.5.4) diff --git a/docs/_config.yml b/docs/_config.yml index 60df5190f5..f89896c168 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -2,7 +2,7 @@ repository: pmd/pmd pmd: version: 7.0.0-SNAPSHOT - previous_version: 6.44.0 + previous_version: 6.47.0 date: ??-?????-2022 release_type: major diff --git a/docs/_data/sidebars/pmd_sidebar.yml b/docs/_data/sidebars/pmd_sidebar.yml index bec4ad0ecc..8d72847030 100644 --- a/docs/_data/sidebars/pmd_sidebar.yml +++ b/docs/_data/sidebars/pmd_sidebar.yml @@ -175,6 +175,18 @@ entries: - title: Error Prone output: web, pdf url: /pmd_rules_ecmascript_errorprone.html + - title: null + output: web, pdf + subfolders: + - title: HTML Rules + output: web, pdf + subfolderitems: + - title: Index + output: web, pdf + url: /pmd_rules_html.html + - title: Best Practices + output: web, pdf + url: /pmd_rules_html_bestpractices.html - title: null output: web, pdf subfolders: @@ -232,6 +244,21 @@ entries: - title: Security output: web, pdf url: /pmd_rules_jsp_security.html + - title: null + output: web, pdf + subfolders: + - title: Kotlin Rules + output: web, pdf + subfolderitems: + - title: Index + output: web, pdf + url: /pmd_rules_kotlin.html + - title: Best Practices + output: web, pdf + url: /pmd_rules_kotlin_bestpractices.html + - title: Error Prone + output: web, pdf + url: /pmd_rules_kotlin_errorprone.html - title: null output: web, pdf subfolders: @@ -370,6 +397,9 @@ entries: - title: JSP url: /pmd_languages_jsp.html output: web, pdf + - title: Kotlin + url: /pmd_languages_kotlin.html + output: web, pdf - title: PLSQL url: /pmd_languages_plsql.html output: web, pdf @@ -379,6 +409,12 @@ entries: - title: XML and XML dialects url: /pmd_languages_xml.html output: web, pdf + - title: HTML + url: /pmd_languages_html.html + output: web, pdf + - title: Gherkin + url: /pmd_languages_gherkin.html + output: web, pdf - title: Developer Documentation output: web, pdf folderitems: diff --git a/docs/_includes/sidebar.html b/docs/_includes/sidebar.html index 8348086ad3..46b916d90e 100644 --- a/docs/_includes/sidebar.html +++ b/docs/_includes/sidebar.html @@ -2,6 +2,7 @@