Compare commits

...
Author SHA1 Message Date
Andreas Dangel 655d1dc6c3 Prepare release of pmd-compat6 7.0.0-rc4 2023-11-18 10:33:47 +01:00
Andreas Dangel 621dffdf4e Merge pull request #4741 from adangel:pmd-compat6-module
Add pmd-compat6 module for maven-pmd-plugin #4741
2023-11-18 10:28:50 +01:00
Andreas Dangel 4df11b35f1 [doc] Improve release notes, migration guide 2023-11-18 10:28:04 +01:00
Andreas Dangel 1e331f08b4 Fix property name skip-pmd-compat6 2023-11-18 10:16:57 +01:00
Andreas Dangel 1c8c5cf434 Bump pmdtester from 1.5.4 to 1.5.5 2023-11-16 10:27:54 +01:00
Andreas Dangel aed95e6870 Remove unused imports 2023-11-14 21:07:37 +01:00
Andreas Dangel 94cdd8a022 [doc] Update release notes and migration guide (#4717) 2023-11-14 20:44:04 +01:00
Andreas Dangel a0814be895 Test formats csv and txt for PMD 2023-11-14 20:31:15 +01:00
Andreas Dangel 9dd646a030 Support formats csv and txt for CPD 2023-11-14 20:21:21 +01:00
Andreas Dangel 16967d3c60 Merge pull request #4719 from ciufudean:master
[java] UnnecessaryCaseChange: example doc toUpperCase() should compare to a capitalized string #4719
2023-11-10 09:23:08 +01:00
Andreas Dangel 9c71f587c6 Add @ciufudean as a contributor 2023-11-10 09:18:48 +01:00
Andreas Dangel 5aaaf2b5ec [doc] Update release notes (#4719) 2023-11-10 09:18:29 +01:00
Andreas Dangel 1140aa2d00 Merge pull request #4724 from Monits:pattern-properties
[java] Make allowExceptionNameRegex a Regex #4724
2023-11-10 09:13:36 +01:00
Andreas Dangel e4d9a02824 [doc] Update release notes (#1027, #4724) 2023-11-10 09:12:39 +01:00
Juan Martín Sotuyo Dodero 4ac1d5f5f3 Bump snayeyaml dependency 2023-11-10 08:57:57 +01:00
Andreas Dangel 9037f708ba Merge pull request #4738 from ethauvin:master
[doc] Added reference to the PMD extension for bld
2023-11-10 08:53:06 +01:00
Andreas Dangel dabd1b1a35 [doc] Update release notes (#4738) 2023-11-10 08:52:36 +01:00
Andreas Dangel 6567cfe0cf Add @ethauvin as a contributor 2023-11-10 08:52:23 +01:00
Andreas Dangel 08de860ed9 [doc] Link to correct pages of build tools from index 2023-11-10 08:51:57 +01:00
Andreas Dangel dd2bb98aa0 Fix PMD dogfood issue 2023-11-09 21:57:21 +01:00
Andreas Dangel 64d20e0368 Fix it verification scripts, only build for java11 2023-11-09 21:29:20 +01:00
Andreas Dangel 1c43a4689c Log failing integration tests 2023-11-09 20:58:41 +01:00
Andreas Dangel b5d0ffb02f New pmd-compat6 module
This makes it possible to use PMD7 with maven-pmd-plugin
2023-11-09 20:02:23 +01:00
Erik C. Thauvin 057f0ac40c Added reference to the PMD extension for bld 2023-11-04 17:03:28 -07:00
Andreas Dangel c5503c938f Merge pull request #4677 from tprouvot:feature/apex/avoidGetGlobalDescribesInLoops
[apex] Add new rule: OperationWithHighCostInLoop #4677
2023-10-28 12:55:33 +02:00
Andreas Dangel 5f5c63bab9 [apex] OperationWithHighCostInLoop: add test for SObjectDescribeOptions 2023-10-28 12:25:27 +02:00
Andreas Dangel 49a3a96ec9 [doc] Update release notes (#4675, #4677) 2023-10-28 12:16:04 +02:00
Andreas Dangel 8b4f677774 Merge branch 'master' into pr-4677 2023-10-28 12:10:35 +02:00
Andreas Dangel c7cc050983 [apex] OperationWithHighCostInLoop - support System.Schema... as well
And improve test cases
2023-10-28 12:07:23 +02:00
Andreas Dangel 95609960ac [apex] OperationWithHighCostInLoop - improve rule doc 2023-10-28 11:52:59 +02:00
Andreas Dangel 6d240b2a75 [apex] performance.xml - sort rules alphabetically 2023-10-28 11:24:56 +02:00
Andreas Dangel df52c374ee Merge pull request #4673 from wener-tiobe:patch-2
[javascript] CPD: Added support for decorator notation #4673
2023-10-26 17:11:34 +02:00
Andreas Dangel db45dcd6db Fix tests 2023-10-26 16:45:06 +02:00
Andreas Dangel e29cb490e0 [doc] Update release notes (#4673) 2023-10-26 16:39:32 +02:00
Andreas Dangel 567bf9ed71 [javascript] Separate @ from Identifier 2023-10-26 16:39:28 +02:00
Andreas Dangel 59a23b1f8a Merge branch 'master' into pr-4673 2023-10-26 16:25:34 +02:00
Andreas Dangel 20a7f612d8 Merge pull request #4594 from Monits:runtime-completion
[cli] Change completion generation to runtime #4594
2023-10-20 12:46:35 +02:00
Andreas Dangel ec3abf0ca2 [doc] Update release notes (#4594) 2023-10-20 11:45:58 +02:00
Andreas Dangel 1951c68589 [java] Revert unrelated change in LawOfDemeter.xml 2023-10-20 11:39:30 +02:00
Andreas Dangel 3d0839dd64 Merge pull request #4670 from pmd/dependabot/github_actions/master/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-10-20 11:29:00 +02:00
Andreas Dangel 504a21cf76 [doc] Update sidebar
The new XML rule introduced xml-bestpractices...
2023-10-20 11:27:02 +02:00
Andreas Dangel bc005a2c61 [doc] Update release notes (#3175, #4659, #4669, #4723, #4640) 2023-10-20 11:05:27 +02:00
Juan Martín Sotuyo Dodero 981f44406f Merge pull request #4686 from adangel/remove-apexversion
[apex] Remove ApexNode.getApexVersion()
2023-10-19 23:56:33 -03:00
Juan Martín Sotuyo Dodero 93f5a68218 Make allowExceptionNameRegex a Regex 2023-10-19 22:00:34 -03:00
Juan Martín Sotuyo Dodero b355e11c17 Merge pull request #4705 from adangel/issue-4645-CommentDefaultAccessModifier
[java] CommentDefaultAccessModifier: Fix ParameterizedTest annotation
2023-10-19 21:43:13 -03:00
Juan Martín Sotuyo Dodero 4c590a71bd Merge branch 'master' into issue-4645-CommentDefaultAccessModifier 2023-10-19 21:42:36 -03:00
Juan Martín Sotuyo Dodero 8e3d60a772 Merge branch 'master' into remove-apexversion 2023-10-19 21:34:35 -03:00
Juan Martín Sotuyo Dodero ef57fb643f Merge pull request #4669 from adangel/doc-bld-tool
[doc] Add bld PMD Extension to Tools / Integrations
2023-10-19 21:13:51 -03:00
Juan Martín Sotuyo Dodero 3b44f93f39 Merge pull request #4661 from adangel/issue-3175-doc-language-modules
[doc] Update language modules
2023-10-19 21:11:52 -03:00
Juan Martín Sotuyo Dodero 854d6e5c05 Merge branch 'master' into issue-3175-doc-language-modules 2023-10-19 21:11:32 -03:00
Juan Martín Sotuyo Dodero be429e9a3d Merge pull request #4659 from adangel/issue-4658-doc-ant-tasks
[ant] Improve documentation
2023-10-19 21:06:10 -03:00
Juan Martín Sotuyo Dodero 5bb4a9290d Add @shai-bennathan as a contributor 2023-10-19 20:59:28 -03:00
Juan Martín Sotuyo Dodero e0633a1c65 Update changelog refs #4640 2023-10-19 20:46:57 -03:00
Juan Martín Sotuyo Dodero 2fa80cbc34 Merge branch 'pr-4640' 2023-10-19 20:44:11 -03:00
Juan Martín Sotuyo Dodero 0e94fe55d1 Fix issue for conf dir too 2023-10-19 20:43:17 -03:00
Juan Martín Sotuyo Dodero a768230ca8 Merge pull request #4612 from adangel/multithreading-errors
[core] Deal with errors from threads in multithreading mode
2023-10-19 20:38:03 -03:00
Juan Martín Sotuyo Dodero 2e4e1275d4 Merge branch 'master' into runtime-completion 2023-10-19 20:32:19 -03:00
Juan Martín Sotuyo Dodero 974092b7b9 Update javadoc to reflect new behavior 2023-10-19 20:30:25 -03:00
Juan Martín Sotuyo Dodero 508034d4dd Assume pmd is in the PATH already when enabling completion 2023-10-19 20:27:04 -03:00
Juan Martín Sotuyo Dodero 7792404e7d Don't hide the completion command 2023-10-19 20:24:26 -03:00
Andreas Dangel 14b9029e97 Merge pull request #4592 from Monits:xml-declaration
[xml] Add MissingEncoding rule #4592
2023-10-19 10:29:53 +02:00
Andreas Dangel 42c7fb0f17 [doc] release notes (#4592) xml-bestpractices/MissingEncoding 2023-10-19 10:29:21 +02:00
Andreas Dangel 7fc50e434c [xml] MissingEncoding - fix rule metadata 2023-10-19 10:24:45 +02:00
Andreas Dangel e92de6c1da [xml] MissingEncoding - only look at root document element 2023-10-19 10:16:10 +02:00
Andreas Dangel 7b69ff7355 Merge branch 'master' into pr-4592 2023-10-19 10:10:55 +02:00
ciufudean 453685d6c4 toUpperCase() should compare to a capitalized string 2023-10-19 11:09:45 +03:00
Andreas Dangel 0c53b69e82 Merge pull request #4586 from adangel:ruleset-xml
Use explicit encoding in ruleset xml files #4586
2023-10-19 09:41:57 +02:00
Andreas Dangel 2450177da6 [doc] Update release notes (#4586) 2023-10-19 09:40:19 +02:00
Andreas Dangel b9bc6ac58b Merge pull request #4699 from adangel:build-with-java21
Make PMD buildable with java 21 #4699
2023-10-19 09:37:05 +02:00
Andreas Dangel 809e1f8763 [doc] Update release notes (#4699) 2023-10-19 09:35:24 +02:00
Andreas Dangel d983be0a83 [ci] Use ga of java 21 from adoptium 2023-10-19 09:35:04 +02:00
Andreas Dangel 6366dc3d97 Bump byte-buddy from 1.12.19 to 1.14.9 2023-10-18 17:24:01 +02:00
Andreas Dangel 546a28aa23 Revert "[core] PmdAnalysisTest: Use concrete class to spy on"
This reverts commit df6a271f4f.
2023-10-18 17:23:26 +02:00
Thomas ProuvotandAndreas Dangel f4c3fc02a8 Update pmd-apex/src/main/resources/category/apex/performance.xml
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2023-10-18 15:42:09 +02:00
Thomas ProuvotandAndreas Dangel f0f05c6e2c Update pmd-apex/src/main/resources/category/apex/performance.xml
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2023-10-18 15:41:38 +02:00
Andreas Dangel 2bbb193d4e Merge pull request #4561 from adangel:issue-2847-new-rule-explicit-types
[java] New Rule: Use Explicit Types #4561
2023-10-06 19:51:40 +02:00
Andreas Dangel f7c913084a Add @harbulot as a contributor 2023-10-06 19:44:21 +02:00
Andreas Dangel e31c77c101 Merge pull request #4591 from Monits:fix-4578
[java] Fix #4578 - CommentDefaultAccessModifier comment needs to be before annotation if present #4591
2023-10-06 19:43:57 +02:00
Andreas Dangel 01a8a36f49 Merge branch 'master' into pr-4591 2023-10-06 19:15:58 +02:00
Andreas Dangel 8aeb45d9d7 [doc] Update release notes (#2847) 2023-10-06 19:06:57 +02:00
Andreas Dangel e9ed7dc25c [java] Fix quickstart ruleset for new rule UseExplicitTypes 2023-10-06 19:06:42 +02:00
Andreas Dangel 4ca9b26abb Merge branch 'master' into issue-2847-new-rule-explicit-types 2023-10-06 19:01:53 +02:00
Andreas Dangel c071143880 [java] CommentDefaultAccessModifier: Fix ParameterizedTest annotation
Fixes #4645
2023-10-06 18:58:15 +02:00
Andreas Dangel 89c7da82f4 [doc] Restore release notes for next rc 2023-09-30 20:52:56 +02:00
Andreas Dangel 70e25642ff [ci] Fix build scripts 2023-09-30 20:44:03 +02:00
Andreas Dangel 96e897ecdd Prepare next development version [skip ci] 2023-09-30 17:16:58 +02:00
Andreas Dangel 345bb24a25 [release] prepare for next development iteration 2023-09-30 17:15:59 +02:00
Andreas Dangel df6a271f4f [core] PmdAnalysisTest: Use concrete class to spy on
This makes mockito be happy even with java21.
2023-09-29 14:56:20 +02:00
Andreas Dangel 3e7e050251 [apex] Remove ApexNode.getApexVersion() 2023-09-22 19:39:42 +02:00
Thomas Prouvot 2d7521401d Add apex new rule OperationWithHighCostInLoop 2023-09-14 10:10:37 +02:00
wener ec36fcc52f Fixed stylecheck issue. 2023-09-12 13:09:49 +02:00
wener dca539b841 Added unittest for decorators. 2023-09-12 11:30:34 +02:00
Wener 940585de9a Update TypeScriptTokenizerTest.java 2023-09-12 11:05:21 +02:00
Wener e0b3d206c2 Create decorator.ts 2023-09-12 10:50:05 +02:00
Wener 836230b7e7 Added support for "@" in identifiers
This is to resolve the following error on a typescript file:

[main] ERROR net.sourceforge.pmd.cli - Error while tokenizing: Lexical error in file '.\TableList.js' at
 line 67, column 1: "@" (64), after : "" (in lexical state DEFAULT)
2023-09-12 10:36:12 +02:00
dependabot[bot] c7401e130b Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 03:41:17 +00:00
Andreas Dangel 518a5ee747 [doc] Add style for blockquotes 2023-09-09 12:00:41 +02:00
Andreas Dangel 839539d14b [doc] Add bld PMD Extension to Tools / Integrations 2023-09-09 11:48:18 +02:00
Andreas Dangel 52381a2acb Update TODO [skip ci] 2023-09-08 21:12:44 +02:00
Andreas Dangel ced61fb9bf [doc] Create experimental features page 2023-09-08 21:08:40 +02:00
Andreas Dangel 6978f4020c [doc] Improve language docs
- add links to language docs
- make summary consistent
- rename TSql -> T-SQL
2023-09-08 21:01:54 +02:00
Andreas Dangel 039f5fbd85 [doc] Improve language docs 2023-09-05 19:53:21 +02:00
Andreas Dangel 81b1d7e32b [doc] Add tags PmdCapableLanguage and CpdCapableLanguage 2023-09-04 19:18:50 +02:00
Andreas Dangel 92b2718da7 Fix unit test 2023-09-04 19:09:21 +02:00
Andreas Dangel 91a1c21680 [doc] jdoc tag: Report location incl. linenumber for warnings 2023-09-01 13:00:45 +02:00
Andreas Dangel 107b8e5b67 [doc] Add pages for all supported language 2023-09-01 12:13:56 +02:00
Andreas Dangel ca40dc41b0 [doc] Add language info summary 2023-09-01 09:41:46 +02:00
Andreas Dangel 291a5aa956 [doc] Update language module docs (apex, java, visualforce) 2023-08-31 17:17:54 +02:00
Andreas Dangel 6e61b9f2a8 [ant] Improve documentation
Refs #4658
2023-08-31 14:42:53 +02:00
Andreas Dangel 5d873fd241 Merge branch 'master' into issue-2847-new-rule-explicit-types 2023-08-28 20:26:17 +02:00
Andreas Dangel e33be0ba48 [java] UseExplicitTypes - move to category codestyle 2023-08-28 20:26:05 +02:00
Andreas Dangel 34cd92c55e [java] UseExplicitTypes - improve rule documentation 2023-08-28 19:42:22 +02:00
Shai BennathanandJuan Martín Sotuyo Dodero 56ae02ad35 Update pmd-dist/src/main/resources/scripts/pmd
Co-authored-by: Juan Martín Sotuyo Dodero <juansotuyo@gmail.com>
2023-08-07 15:32:11 +03:00
Shai Bennathan 295ee304a4 Issue: Launch failure via bin/bash
Currently if run.sh is launched via 'bin/bash run.sh', when run.sh is not in the local directory (i.e., accessed via path env var) it thinks it runs in the local directory.
This change makes sure that all cases are covered.
Tested on local Ubuntu 22.04.
2023-08-07 12:51:09 +03:00
Andreas Dangel 6fc45493e7 [core] Deal with errors from threads in multithreading mode
If an error occurs in multithreading mode, PMD now
rethrows this. Such errors indicate a serious problem
like incomplete runtime classpath of PMD or other
VM error (out of memory) that shouldn't be swallowed.
2023-06-29 18:56:10 +02:00
Juan Martín Sotuyo Dodero 2fc4cb9929 Remove completion dependency from dist 2023-06-09 11:42:54 -03:00
Juan Martín Sotuyo Dodero 7062d79577 Fix indentation 2023-06-08 10:13:46 -03:00
Juan Martín Sotuyo Dodero 5a55af46d3 Change completion generation to runtime
- We no longer ship a pre-built completion script
 - A hidden subcommand is available to generate it dynamically based on
   actually available languages.
 - We update docs everywhere accordingly.
2023-06-08 00:28:58 -03:00
Juan Martín Sotuyo Dodero febd279be2 Fix import order 2023-06-07 10:10:12 -03:00
Juan Martín Sotuyo Dodero 3bac231516 Fix import order 2023-06-07 00:51:15 -03:00
Juan Martín Sotuyo Dodero 7f66265c1c Update AST tests 2023-06-06 23:07:20 -03:00
Juan Martín Sotuyo Dodero 34a3f792c9 Add test cases 2023-06-05 23:59:41 -03:00
Juan Martín Sotuyo Dodero 59fca83d10 Add a new rule for MissingEncoding
- Enforce XML files have an encoding set in the XML Declaration
2023-06-05 23:59:10 -03:00
Juan Martín Sotuyo Dodero f2c7da364c Expose XML Declaratoin as attributes 2023-06-05 23:58:39 -03:00
Juan Martín Sotuyo Dodero e9ee4a94c6 Update changelog, refs #4578 2023-06-05 23:05:07 -03:00
Juan Martín Sotuyo Dodero 1d6f0a43b5 Be more explicit as to when we want to extend the range 2023-06-05 23:02:59 -03:00
Juan Martín Sotuyo Dodero d1daf9e3fd Allow comment parsing to include comments after
- This is safe even for the last token
 - I don't love the semantics of this… get leading comments vs token
   in, and actually allowing tokens "around"… a lot of this is for
   the AccessNode special case and what we consider "leading" to be for
   those
2023-06-05 19:49:53 -03:00
Juan Martín Sotuyo Dodero e342bfd7f8 Add failing use case for #4578 2023-06-05 19:49:26 -03:00
Andreas Dangel 451a364ed7 Use explicit encoding in internal ruleset files 2023-06-01 17:36:15 +02:00
Andreas Dangel 8a89a4c786 Use explicit encoding in ruleset files 2023-06-01 17:29:24 +02:00
Andreas Dangel 665187633f [java] Update quickstart.xml ruleset 2023-05-14 11:11:09 +02:00
Andreas Dangel d49178ae5f [java] New Rule: Use Explicit Types
Fixes #2847
2023-05-14 11:05:30 +02:00
390 changed files with 7256 additions and 1140 deletions

No files matched your search

+37
View File
@@ -7259,6 +7259,43 @@
"contributions": [
"bug"
]
},
{
"login": "harbulot",
"name": "Bruno Harbulot",
"avatar_url": "https://avatars.githubusercontent.com/u/80994?v=4",
"profile": "http://blog.distributedmatter.net/",
"contributions": [
"bug"
]
},
{
"login": "shai-bennathan",
"name": "Shai Bennathan",
"avatar_url": "https://avatars.githubusercontent.com/u/62336907?v=4",
"profile": "https://github.com/shai-bennathan",
"contributions": [
"bug",
"code"
]
},
{
"login": "ethauvin",
"name": "Erik C. Thauvin",
"avatar_url": "https://avatars.githubusercontent.com/u/705618?v=4",
"profile": "https://erik.thauvin.net/",
"contributions": [
"doc"
]
},
{
"login": "ciufudean",
"name": "ciufudean",
"avatar_url": "https://avatars.githubusercontent.com/u/19208954?v=4",
"profile": "https://github.com/ciufudean",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
+2 -2
View File
@@ -19,7 +19,7 @@ function build() {
pmd_ci_log_info "Install openjdk17 for integration tests and pmd-regression-tests"
pmd_ci_openjdk_install_adoptium 17
pmd_ci_log_info "Install openjdk21 for integration tests and pmd-regression-tests"
pmd_ci_openjdk_install_adoptium "21-ea"
pmd_ci_openjdk_install_adoptium 21
PMD_MAVEN_EXTRA_OPTS=(
-Djava8.home="${HOME}/openjdk8"
-Djava17.home="${HOME}/openjdk17"
@@ -190,7 +190,7 @@ function pmd_ci_build_run() {
./mvnw clean deploy -P"${mvn_profiles}",'!cli-dist' --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
else
# b) pmd-cli and pmd-dist
./mvnw clean deploy -pl pmd-cli,pmd-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
./mvnw clean deploy -P"${mvn_profiles},cli-dist" -pl pmd-cli,pmd-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
fi
else
pmd_ci_log_info "This is a snapshot build"
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="All Regression Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
os: [ ubuntu-latest, windows-latest, macos-latest ]
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/cache@v3
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 100
- name: Setup Environment
+1 -1
View File
@@ -15,7 +15,7 @@ jobs:
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
+10 -10
View File
@@ -3,7 +3,7 @@ GEM
specs:
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.1.1)
base64 (0.2.0)
claide (1.1.0)
claide-plugins (0.9.2)
cork
@@ -13,7 +13,7 @@ GEM
concurrent-ruby (1.2.2)
cork (0.3.0)
colored2 (~> 3.1)
danger (9.3.2)
danger (9.4.0)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
@@ -24,7 +24,7 @@ GEM
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
no_proxy_fix
octokit (~> 6.0)
octokit (>= 6.0, < 8.0)
terminal-table (>= 1, < 4)
differ (0.1.2)
et-orbi (1.2.7)
@@ -36,7 +36,7 @@ GEM
faraday-http-cache (2.5.0)
faraday (>= 0.8)
faraday-net_http (3.0.2)
fugit (1.8.1)
fugit (1.9.0)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
git (1.18.0)
@@ -48,17 +48,17 @@ GEM
kramdown (~> 2.0)
liquid (5.4.0)
logger-colors (1.0.0)
mini_portile2 (2.8.4)
mini_portile2 (2.8.5)
nap (1.1.0)
no_proxy_fix (0.1.2)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
octokit (6.1.1)
octokit (7.2.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
open4 (1.3.4)
pmdtester (1.5.4)
pmdtester (1.5.5)
differ (~> 0.1)
liquid (~> 5.4)
logger-colors (~> 1.0)
@@ -67,10 +67,10 @@ GEM
slop (~> 4.9)
public_suffix (5.0.3)
raabro (1.4.0)
racc (1.7.1)
racc (1.7.3)
rchardet (1.8.0)
rexml (3.2.6)
rouge (4.1.3)
rouge (4.2.0)
ruby2_keywords (0.0.5)
rufus-scheduler (3.9.1)
fugit (~> 1.1, >= 1.1.6)
@@ -83,7 +83,7 @@ GEM
unicode-display_width (>= 1.1.1, < 3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
PLATFORMS
ruby
+1 -1
View File
@@ -262,7 +262,7 @@ git checkout master
# make sure parent reference is correct
./mvnw versions:update-parent -DparentVersion="${DEVELOPMENT_VERSION}" -DskipResolution=true -DgenerateBackupPoms=false -pl pmd-cli,pmd-dist
git add pmd-cli/pom.xml pmd-dist/pom.xml
changes=$(git status --porcelain 2>/dev/null| grep -c -E "^[AMDRC]")
changes=$(git status --porcelain 2>/dev/null | grep -c -E "^[AMDRC]" || true)
if [ "$changes" -gt 0 ]; then
git commit -m "Prepare next development version [skip ci]"
git push origin "${CURRENT_BRANCH}"
+2 -2
View File
@@ -1,9 +1,9 @@
repository: pmd/pmd
pmd:
version: 7.0.0-rc4
version: 7.0.0-SNAPSHOT
previous_version: 6.55.0
date: 30-September-2023
date: ??-?????-2023
release_type: major
# release types: major, minor, bugfix
+79 -14
View File
@@ -124,6 +124,9 @@ entries:
- title: PMD Java API
output: web, pdf
url: /pmd_userdocs_tools_java_api.html
- title: bld PMD Extension
output: web, pdf
url: /pmd_userdocs_tools_bld.html
- title: CI integrations
output: web, pdf
url: /pmd_userdocs_tools_ci.html
@@ -313,7 +316,7 @@ entries:
- title: null
output: web, pdf
subfolders:
- title: Salesforce VisualForce Rules
- title: Salesforce Visualforce Rules
output: web, pdf
subfolderitems:
- title: Index
@@ -349,7 +352,7 @@ entries:
- title: null
output: web, pdf
subfolders:
- title: VM Rules
- title: Velocity Template Language (VTL) Rules
output: web, pdf
subfolderitems:
- title: Index
@@ -382,6 +385,9 @@ entries:
- title: Index
output: web, pdf
url: /pmd_rules_xml.html
- title: Best Practices
output: web, pdf
url: /pmd_rules_xml_bestpractices.html
- title: Error Prone
output: web, pdf
url: /pmd_rules_xml_errorprone.html
@@ -403,12 +409,41 @@ entries:
- title: Language-Specific Documentation
output: web, pdf
folderitems:
- title: Overview
url: /pmd_languages_index.html
output: web, pdf
- title: Language configuration
url: /pmd_languages_configuration.html
output: web, pdf
- title: Apex
url: /pmd_languages_apex.html
output: web, pdf
- title: C/C++
url: /pmd_languages_cpp.html
output: web, pdf
- title: C#
url: /pmd_languages_cs.html
output: web, pdf
- title: Coco
url: /pmd_languages_coco.html
output: web, pdf
- title: Dart
url: /pmd_languages_dart.html
output: web, pdf
- title: Fortran
url: /pmd_languages_fortran.html
output: web, pdf
- title: Gherkin
url: /pmd_languages_gherkin.html
output: web, pdf
- title: Go
url: /pmd_languages_go.html
output: web, pdf
- title: Groovy
url: /pmd_languages_groovy.html
- title: HTML
url: /pmd_languages_html.html
output: web, pdf
- title: Java
url: /pmd_languages_java.html
output: web, pdf
@@ -418,30 +453,57 @@ entries:
- title: JSP
url: /pmd_languages_jsp.html
output: web, pdf
- title: Julia
url: /pmd_languages_julia.html
output: web, pdf
- title: Kotlin
url: /pmd_languages_kotlin.html
output: web, pdf
- title: Lua
url: /pmd_languages_lua.html
output: web, pdf
- title: Matlab
url: /pmd_languages_matlab.html
output: web, pdf
- title: Modelica
url: /pmd_languages_modelica.html
output: web, pdf
- title: Objective-C
url: /pmd_languages_objectivec.html
output: web, pdf
- title: Perl
url: /pmd_languages_perl.html
output: web, pdf
- title: PHP
url: /pmd_languages_php.html
output: web, pdf
- title: PLSQL
url: /pmd_languages_plsql.html
output: web, pdf
- title: Python
url: /pmd_languages_python.html
output: web, pdf
- title: Ruby
url: /pmd_languages_ruby.html
output: web, pdf
- title: Scala
url: /pmd_languages_scala.html
output: web, pdf
- title: Swift
url: /pmd_languages_swift.html
output: web, pdf
- title: T-SQL
url: /pmd_languages_tsql.html
output: web, pdf
- title: Visualforce
url: /pmd_languages_visualforce.html
output: web, pdf
- title: Velocity Template Language (VTL)
url: /pmd_languages_vm.html
output: web, pdf
- 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: 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:
@@ -493,6 +555,9 @@ entries:
- title: Creating (XML) dump of the AST
url: /pmd_devdocs_experimental_ast_dump.html
output: web, pdf
- title: List of experimental Features
url: /tag_experimental.html
output: web, pdf
- title: Project documentation
output: web, pdf
folderitems:
+3
View File
@@ -10,3 +10,6 @@ allowed-tags:
- tools # About tools and integrations, Maven, gradle, etc.
- devdocs # About PMD internals, contributing, building, projects
- languages # Language-specific documentation pages
- PmdCapableLanguage
- CpdCapableLanguage
- experimental
+12
View File
@@ -0,0 +1,12 @@
<details class="language-info">
<summary>Language Info for {{include.name}}</summary>
<div class="card">
<ul class="list-group list-group-flush">
{% if include.since %}<li class="list-group-item">Since PMD {{include.since}}</li>{% endif %}
<li class="list-group-item">Implementation: {% jdoc include.implementation %}</li>
<li class="list-group-item">Id: {{include.id}}</li>
<li class="list-group-item">PMD: {% if include.supports_pmd %}✔️{% else %}❌{% endif %}</li>
<li class="list-group-item">CPD: {% if include.supports_cpd %}✔️{% else %}❌{% endif %}</li>
</ul>
</div>
</details>
+21 -12
View File
@@ -106,16 +106,25 @@ class JavadocTag < Liquid::Tag
def initialize(tag_name, doc_ref, tokens)
super
# sanitize a little
doc_ref.delete! " \"'"
@doc_ref = doc_ref
end
arr = doc_ref.split("#") # split into fqcn + member suffix
def render(var_ctx)
# maybe the parameter is actually a variable - try to resolve it first
if var_ctx.key?(@doc_ref)
@doc_ref = var_ctx[@doc_ref]
end
# sanitize a little
@doc_ref.delete! " \"'"
arr = @doc_ref.split("#") # split into fqcn + member suffix
@type_fqcn = arr[0]
@member_suffix = arr[1] || "" # default to empty string
unless Regexp.new('(!\w*!)?' + Regexp.union(JDocNamespaceDeclaration::NAMESPACED_FQCN_REGEX, JDocNamespaceDeclaration::SYM_REGEX).source ) =~ @type_fqcn
fail "Wrong syntax for type reference, expected eg nspace::a.b.C, !opts!nspace::a.b.C, or :nspace"
fail "Wrong syntax for type reference, expected eg nspace::a.b.C, !opts!nspace::a.b.C, or :nspace, but got \'" + @type_fqcn + "\'"
end
# If no options, then split produces [@type_fqcn]
@@ -130,14 +139,11 @@ class JavadocTag < Liquid::Tag
elsif tag_name == "jdoc_old"
@use_previous_api_version = true
end
end
def render(var_ctx)
artifact_name, @type_fqcn = JDocNamespaceDeclaration::parse_fqcn(@type_fqcn, var_ctx)
resolved_type = JavadocTag::fqcn_type(artifact_name, @type_fqcn)
JavadocTag::diagnose(artifact_name, @type_fqcn, @is_package_ref, resolved_type)
diagnose(var_ctx, artifact_name, @type_fqcn, @is_package_ref, resolved_type)
# Expand FQCN of arguments
@member_suffix.gsub!(JDocNamespaceDeclaration::NAMESPACED_FQCN_REGEX) {|fqcn| JDocNamespaceDeclaration::parse_fqcn(fqcn, var_ctx)[1]}
@@ -215,15 +221,18 @@ class JavadocTag < Liquid::Tag
BASE_PMD_DIR = File.join(File.expand_path(File.dirname(__FILE__)), "..", "..")
def self.diagnose(artifact_id, fqcn, expect_package, resolved_type)
def diagnose(context, artifact_id, fqcn, expect_package, resolved_type)
tag_name= expect_package ? "jdoc_package" : "jdoc"
# Note: the line numbers don't account for the frontmatter lines
# See https://github.com/jekyll/jekyll/issues/7192 and https://github.com/jekyll/jekyll/pull/9385
location = "#{context['page']['path']}:#{@line_number}+?"
if resolved_type == :package && !expect_package
warn "\e[33;1m#{tag_name} generated link to #{fqcn}, but it was found to be a package name. Did you mean to use jdoc_package instead of jdoc?\e[0m"
warn "\e[33;1m#{location}: #{tag_name} generated link to #{fqcn}, but it was found to be a package name. Did you mean to use jdoc_package instead of jdoc?\e[0m"
elsif resolved_type == :file && expect_package
warn "\e[33;1m#{tag_name} generated link to #{fqcn}, but it was found to be a java file name. Did you mean to use jdoc instead of jdoc_package?\e[0m"
warn "\e[33;1m#{location}: #{tag_name} generated link to #{fqcn}, but it was found to be a java file name. Did you mean to use jdoc instead of jdoc_package?\e[0m"
elsif !resolved_type
warn "\e[33;1m#{tag_name} generated link to #{fqcn}, but the #{expect_package ? "directory" : "source file"} couldn't be found in the source tree of #{artifact_id}\e[0m"
warn "\e[33;1m#{location}: #{tag_name} generated link to #{fqcn}, but the #{expect_package ? "directory" : "source file"} couldn't be found in the source tree of #{artifact_id}\e[0m"
end
end
+4 -3
View File
@@ -99,10 +99,11 @@ class JDocNamespaceDeclaration < Liquid::Tag
private
JDOC_NAMESPACE_MAP = "jdoc_nspaces"
RESERVED_NSPACES = ['ant', 'apex', 'cli', 'core', 'cpp', 'cs', 'dart', 'dist', 'doc', 'fortran', 'go', 'groovy', 'java',
'javascript', 'jsp',
RESERVED_NSPACES = ['ant', 'apex', 'cli', 'coco', 'core', 'cpp', 'cs', 'dart', 'dist', 'doc',
'fortran', 'gherkin', 'go', 'groovy', 'html', 'java',
'javascript', 'jsp', 'julia',
'kotlin', 'lang-test', 'lua', 'matlab', 'objectivec', 'perl', 'php', 'plsql', 'python', 'ruby', 'scala', 'swift',
'test', 'test-schema', 'ui',
'test', 'test-schema', 'tsql', 'ui',
'modelica', 'visualforce', 'vm', 'xml'].flat_map {|m| [m, "pmd-" + m]}
def self.make_base_namespaces
+7
View File
@@ -1008,8 +1008,11 @@ span.soft {
}
@media (min-height: 600px) and (min-width: 990px) {
/* sticky sidebar for big screens */
#mysidebar {
position: fixed !important;
overflow: scroll;
height: 80%;
}
}
@@ -1268,3 +1271,7 @@ h4.panel-title {
a.edit-header {
font-size: 15px;
}
.language-info {
margin: 2em;
}
+7
View File
@@ -87,3 +87,10 @@ li.sidebarTitle {
margin-bottom:2.5px;
margin-left:5px;
}
blockquote {
border-left: 5px solid #01c172;
padding: 10px 0 10px 1rem;
margin: 1rem 0;
font-style: italic;
}
+2 -1
View File
@@ -39,7 +39,8 @@ used as a quality gate, to enforce a coding standard for your codebase. Among ot
things, PMD can be run:
* As a [Maven goal](pmd_userdocs_tools_maven.html)
* As an [Ant task](pmd_userdocs_tools_ant.html)
* As a [Gradle task](https://docs.gradle.org/current/userguide/pmd_plugin.html)
* As a [Gradle task](pmd_userdocs_tools_gradle.html)
* As a [bld operation](pmd_userdocs_tools_bld.html)
* From [command-line](pmd_userdocs_installation.html#running-pmd-via-command-line)
**CPD**, the **copy-paste detector**, is also distributed with PMD. You can also use it
@@ -142,7 +142,9 @@ definitely don't come for free. It is much effort and requires perseverance to i
* For a minimal implementation, it just needs to return a parser *(see step #6)*.
* It can be used to provide other features for your language like
* violation suppression logic
* violation decorators, to add additional language specific information to the created violations
* {% jdoc core::reporting::ViolationDecorator %}s, to add additional language specific information to the
created violations. The [Java language module](pmd_languages_java.html#violation-decorators) uses this to
provide the method name or class name, where the violation occurred.
* metrics
* custom XPath functions
@@ -228,3 +230,25 @@ definitely don't come for free. It is much effort and requires perseverance to i
This will load all rulesets and verify, that all required attributes are provided.
*Note:* You'll need to add your ruleset to `categories.properties`, so that it can be found.
### 15. Create documentation page
Finishing up your new language module by adding a page in the documentation. Create a new markdown file
`<langId>.md` in `docs/pages/pmd/languages/`. This file should have the following frontmatter:
```
---
title: <Language Name>
permalink: pmd_languages_<langId>.html
last_updated: <Month> <Year> (<PMD Version>)
tags: [languages, PmdCapableLanguage, CpdCapableLanguage]
---
```
On this page, language specifics can be documented, e.g. when the language was first supported by PMD.
There is also the following Jekyll Include, that creates summary box for the language:
```
{% raw %}
{% include language_info.html name='<Language Name>' id='<langId>' implementation='<langId>::lang.<langId>.<langId>LanguageModule' supports_cpd=true supports_pmd=true %}
{% endraw %}
```
@@ -81,7 +81,9 @@ definitely don't come for free. It is much effort and requires perseverance to i
* For a minimal implementation, it just needs to return a parser *(see step #5)*.
* It can be used to provide other features for your language like
* violation suppression logic
* violation decorators, to add additional language specific information to the created violations
* {% jdoc core::reporting::ViolationDecorator %}s, to add additional language specific information to the
created violations. The [Java language module](pmd_languages_java.html#violation-decorators) uses this to
provide the method name or class name, where the violation occurred.
* metrics (see below "Optional features")
* custom XPath functions
* See `VmHandler` class as an example
@@ -181,6 +183,29 @@ The Scala module also has a test, written in Kotlin instead of Java:
*Note:* You'll need to add your category ruleset to `categories.properties`, so that it can be found.
### 13. Create documentation page
Finishing up your new language module by adding a page in the documentation. Create a new markdown file
`<langId>.md` in `docs/pages/pmd/languages/`. This file should have the following frontmatter:
```
---
title: <Language Name>
permalink: pmd_languages_<langId>.html
last_updated: <Month> <Year> (<PMD Version>)
tags: [languages, PmdCapableLanguage, CpdCapableLanguage]
---
```
On this page, language specifics can be documented, e.g. when the language was first supported by PMD.
There is also the following Jekyll Include, that creates summary box for the language:
```
{% raw %}
{% include language_info.html name='<Language Name>' id='<langId>' implementation='<langId>::lang.<langId>.<langId>LanguageModule' supports_cpd=true supports_pmd=true %}
{% endraw %}
```
## Debugging with Rule Designer
When implementing your grammar it may be very useful to see how PMD parses your example files.
@@ -79,6 +79,27 @@ If your language only supports CPD, then you can subclass {% jdoc core::lang.imp
5. Add some tests for your tokenizer by following the [section below](#testing-your-implementation).
6. Finishing up your new language module by adding a page in the documentation. Create a new markdown file
`<langId>.md` in `docs/pages/pmd/languages/`. This file should have the following frontmatter:
```
---
title: <Language Name>
permalink: pmd_languages_<langId>.html
last_updated: <Month> <Year> (<PMD Version>)
tags: [languages, CpdCapableLanguage]
---
```
On this page, language specifics can be documented, e.g. when the language was first supported by PMD.
There is also the following Jekyll Include, that creates summary box for the language:
```
{% raw %}
{% include language_info.html name='<Language Name>' id='<langId>' implementation='<langId>::lang.<langId>.<langId>LanguageModule' supports_cpd=true %}
{% endraw %}
```
### Declaring tokenizer options
To make the tokenizer configurable, first define some property descriptors using
+30 -5
View File
@@ -1,15 +1,40 @@
---
title: Apex support
permalink: pmd_languages_apex.html
last_updated: September 2023 (7.0.0)
author: Clément Fournier
last_updated: March 2021 (7.0.0)
tags: [languages]
tags: [languages, PmdCapableLanguage, CpdCapableLanguage]
summary: "Apex-specific features and guidance"
---
{% include warning.html content="Todo for pmd 7" %}
> [Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm) is a strongly
> typed, object-oriented programming language that allows developers to execute flow and
> transaction control statements on the Salesforce Platform server, in conjunction with calls to the API.
### Metrics framework
{% include language_info.html name='Apex' id='apex' implementation='apex::lang.apex.ApexLanguageModule' supports_pmd=true supports_cpd=true since='5.5.0' %}
In order to use code metrics in Java, use the metrics constants in {% jdoc apex::lang.apex.metrics.ApexMetrics %},
## Metrics framework
In order to use code metrics in Apex, use the metrics constants in {% jdoc apex::lang.apex.metrics.ApexMetrics %},
together with {% jdoc core::lang.metrics.MetricsUtil %}.
## Multifile Analysis
Integration happens in {% jdoc apex::lang.apex.multifile.ApexMultifileAnalysis %}. It uses
[ApexLink](https://github.com/nawforce/apex-link). For detailed information, see also [Apexlink POC #2830](https://github.com/pmd/pmd/pull/2830).
{% include note.html content="ApexLink's new home: <https://github.com/apex-dev-tools>" %}
Used for rule {% rule apex/design/UnusedMethod %}
## Language Properties
See [Apex language properties](pmd_languages_configuration.html#apex-language-properties)
## Parser
We use Jorje, the Apex parsers that is shipped within the Apex Language Server. This is part of
the [Salesforce Extensions for VS Code](https://github.com/forcedotcom/salesforcedx-vscode).
We take the binary from <https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex/out>
and provide it as a maven dependency (see [pmd-apex-jorje](https://github.com/pmd/pmd/tree/master/pmd-apex-jorje)).
+8 -3
View File
@@ -1,10 +1,15 @@
---
title: Coco
title: Coco support
permalink: pmd_languages_coco.html
last_updated: September 2023 (7.0.0)
tags: [languages, CpdCapableLanguage]
summary: "Coco features and guidance"
---
Coco is a modern programming language designed specifically for building event-driven software.
It is part of the Coco Platform from <https://cocotec.io/>.
> Coco is a modern programming language designed specifically for building event-driven software.
> It is part of the Coco Platform from <https://cocotec.io/>.
{% include language_info.html name='Coco' id='coco' implementation='coco::lang.coco.CocoLanguageModule' supports_cpd=true since='7.0.0' %}
## Support in PMD
Starting from version 7.0.0, Coco support was added to CPD.
+13
View File
@@ -0,0 +1,13 @@
---
title: C/C++ support
permalink: pmd_languages_cpp.html
last_updated: September 2023 (7.0.0)
tags: [languages, CpdCapableLanguage]
summary: "C/C++ features and guidance"
---
{% include language_info.html name='C++' id='cpp' implementation='cpp::lang.cpp.CppLanguageModule' supports_cpd=true since='3.5' %}
## Language Properties
See [Cpp language properties](pmd_languages_configuration.html#cpp-language-properties)
+9
View File
@@ -0,0 +1,9 @@
---
title: C# support
permalink: pmd_languages_cs.html
last_updated: September 2023 (7.0.0)
tags: [languages, CpdCapableLanguage]
summary: "C#-specific features and guidance"
---
{% include language_info.html name='C#' id='cs' implementation='cs::lang.cs.CsLanguageModule' supports_cpd=true since='4.3' %}
+11
View File
@@ -0,0 +1,11 @@
---
title: Dart support
permalink: pmd_languages_dart.html
last_updated: September 2023 (7.0.0)
tags: [languages, CpdCapableLanguage]
summary: "Dart-specific features and guidance"
---
> [Dart](https://dart.dev/) is a client-optimized language for fast apps on any platform.
{% include language_info.html name='Dart' id='dart' implementation='dart::lang.dart.DartLanguageModule' supports_cpd=true since='6.14.0' %}
+9
View File
@@ -0,0 +1,9 @@
---
title: Fortran support
permalink: pmd_languages_fortran.html
last_updated: September 2023 (7.0.0)
tags: [languages, CpdCapableLanguage]
summary: "Fortran features and guidance"
---
{% include language_info.html name='Fortran' id='fortran' implementation='fortran::lang.fortran.FortranLanguageModule' supports_cpd=true %}
+6 -1
View File
@@ -1,12 +1,17 @@
---
title: Gherkin
title: Gherkin support
permalink: pmd_languages_gherkin.html
last_updated: September 2023 (7.0.0)
tags: [languages, CpdCapableLanguage]
summary: "Gherkin features and guidance"
---
The [Gherkin](https://cucumber.io/docs/gherkin/) language is used to define test cases for the
[Cucumber](https://cucumber.io/) testing tool for behavior-driven development.
The Gherkin syntax is designed to be non-technical, making it human-readable for a wide audience.
{% include language_info.html name='Gherkin' id='gherkin' implementation='gherkin::lang.gherkin.GherkinLanguageModule' supports_cpd=true since='6.48.0' %}
## Support in PMD
Starting from version 6.48.0, Gherkin support was added to CPD.
+11
View File
@@ -0,0 +1,11 @@
---
title: Go support
permalink: pmd_languages_go.html
last_updated: September 2023 (7.0.0)
tags: [languages, CpdCapableLanguage]
summary: "Go features and guidance"
---
> [Go](https://golang.org/) is a statically typed, compiled high-level programming language.
{% include language_info.html name='Go' id='go' implementation='go::lang.go.GoLanguageModule' supports_cpd=true since='5.2.0' %}
+13
View File
@@ -0,0 +1,13 @@
---
title: Groovy support
permalink: pmd_languages_groovy.html
last_updated: September 2023 (7.0.0)
tags: [languages, CpdCapableLanguage]
summary: "Groovy-specific features and guidance"
---
> [Apache Groovy](https://groovy-lang.org/) is a powerful, optionally typed and dynamic language, with static-typing and
> static compilation capabilities, for the Java platform aimed at improving developer productivity thanks to a concise,
> familiar and easy to learn syntax.
{% include language_info.html name='Groovy' id='groovy' implementation='groovy::lang.groovy.GroovyLanguageModule' supports_cpd=true since='5.5.2' %}
+7 -11
View File
@@ -1,24 +1,20 @@
---
title: Processing HTML files
title: HTML support
permalink: pmd_languages_html.html
last_updated: April 2022 (6.45.0)
last_updated: September 2023 (7.0.0)
tags: [languages, PmdCapableLanguage, CpdCapableLanguage, experimental]
summary: "HTML-specific features and guidance"
---
## The HTML language module
**Since:** 6.45.0
**Minimum Java Runtime:** Java 8
{% include language_info.html name='HTML' id='html' implementation='html::lang.html.HtmlLanguageModule' supports_pmd=true supports_cpd=true since='6.45.0' %}
{% include warning.html content="This language module is experimental and may change any time." %}
The HTML language module uses [jsoup](https://jsoup.org/) for parsing.
XPath 2.0 rules are supported, but the DOM is not always a typical XML/XPath DOM.
XPath rules are supported, but the DOM is not always a typical XML/XPath DOM.
In the Designer, text nodes appear as nodes with name "#text", but they can
be selected as usual using `text()`.
XML Namespaces are not supported. The local name of attributes include the prefix,
XML Namespaces are not supported. The local name of attributes includes the prefix,
so that you have to select attributes by e.g. `//*[@*[local-name() = 'if:true']]`.
Only XPath 1.0 rules are not supported.
Loaded 30 of 390 files, more files were not shown because too many files have changed in this diff. Show more