Compare commits
132
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
655d1dc6c3 | ||
|
|
621dffdf4e | ||
|
|
4df11b35f1 | ||
|
|
1e331f08b4 | ||
|
|
1c8c5cf434 | ||
|
|
aed95e6870 | ||
|
|
94cdd8a022 | ||
|
|
a0814be895 | ||
|
|
9dd646a030 | ||
|
|
16967d3c60 | ||
|
|
9c71f587c6 | ||
|
|
5aaaf2b5ec | ||
|
|
1140aa2d00 | ||
|
|
e4d9a02824 | ||
|
|
4ac1d5f5f3 | ||
|
|
9037f708ba | ||
|
|
dabd1b1a35 | ||
|
|
6567cfe0cf | ||
|
|
08de860ed9 | ||
|
|
dd2bb98aa0 | ||
|
|
64d20e0368 | ||
|
|
1c43a4689c | ||
|
|
b5d0ffb02f | ||
|
|
057f0ac40c | ||
|
|
c5503c938f | ||
|
|
5f5c63bab9 | ||
|
|
49a3a96ec9 | ||
|
|
8b4f677774 | ||
|
|
c7cc050983 | ||
|
|
95609960ac | ||
|
|
6d240b2a75 | ||
|
|
df52c374ee | ||
|
|
db45dcd6db | ||
|
|
e29cb490e0 | ||
|
|
567bf9ed71 | ||
|
|
59a23b1f8a | ||
|
|
20a7f612d8 | ||
|
|
ec3abf0ca2 | ||
|
|
1951c68589 | ||
|
|
3d0839dd64 | ||
|
|
504a21cf76 | ||
|
|
bc005a2c61 | ||
|
|
981f44406f | ||
|
|
93f5a68218 | ||
|
|
b355e11c17 | ||
|
|
4c590a71bd | ||
|
|
8e3d60a772 | ||
|
|
ef57fb643f | ||
|
|
3b44f93f39 | ||
|
|
854d6e5c05 | ||
|
|
be429e9a3d | ||
|
|
5bb4a9290d | ||
|
|
e0633a1c65 | ||
|
|
2fa80cbc34 | ||
|
|
0e94fe55d1 | ||
|
|
a768230ca8 | ||
|
|
2e4e1275d4 | ||
|
|
974092b7b9 | ||
|
|
508034d4dd | ||
|
|
7792404e7d | ||
|
|
14b9029e97 | ||
|
|
42c7fb0f17 | ||
|
|
7fc50e434c | ||
|
|
e92de6c1da | ||
|
|
7b69ff7355 | ||
|
|
453685d6c4 | ||
|
|
0c53b69e82 | ||
|
|
2450177da6 | ||
|
|
b9bc6ac58b | ||
|
|
809e1f8763 | ||
|
|
d983be0a83 | ||
|
|
6366dc3d97 | ||
|
|
546a28aa23 | ||
|
|
f4c3fc02a8 | ||
|
|
f0f05c6e2c | ||
|
|
2bbb193d4e | ||
|
|
f7c913084a | ||
|
|
e31c77c101 | ||
|
|
01a8a36f49 | ||
|
|
8aeb45d9d7 | ||
|
|
e9ed7dc25c | ||
|
|
4ca9b26abb | ||
|
|
c071143880 | ||
|
|
89c7da82f4 | ||
|
|
70e25642ff | ||
|
|
96e897ecdd | ||
|
|
345bb24a25 | ||
|
|
df6a271f4f | ||
|
|
3e7e050251 | ||
|
|
2d7521401d | ||
|
|
ec36fcc52f | ||
|
|
dca539b841 | ||
|
|
940585de9a | ||
|
|
e0b3d206c2 | ||
|
|
836230b7e7 | ||
|
|
c7401e130b | ||
|
|
518a5ee747 | ||
|
|
839539d14b | ||
|
|
52381a2acb | ||
|
|
ced61fb9bf | ||
|
|
6978f4020c | ||
|
|
039f5fbd85 | ||
|
|
81b1d7e32b | ||
|
|
92b2718da7 | ||
|
|
91a1c21680 | ||
|
|
107b8e5b67 | ||
|
|
ca40dc41b0 | ||
|
|
291a5aa956 | ||
|
|
6e61b9f2a8 | ||
|
|
5d873fd241 | ||
|
|
e33be0ba48 | ||
|
|
34cd92c55e | ||
|
|
56ae02ad35 | ||
|
|
295ee304a4 | ||
|
|
6fc45493e7 | ||
|
|
2fc4cb9929 | ||
|
|
7062d79577 | ||
|
|
5a55af46d3 | ||
|
|
febd279be2 | ||
|
|
3bac231516 | ||
|
|
7f66265c1c | ||
|
|
34a3f792c9 | ||
|
|
59fca83d10 | ||
|
|
f2c7da364c | ||
|
|
e9ee4a94c6 | ||
|
|
1d6f0a43b5 | ||
|
|
d1daf9e3fd | ||
|
|
e342bfd7f8 | ||
|
|
451a364ed7 | ||
|
|
8a89a4c786 | ||
|
|
665187633f | ||
|
|
d49178ae5f |
No files matched your search
@@ -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
@@ -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,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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
@@ -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>
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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)).
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
@@ -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' %}
|
||||
@@ -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' %}
|
||||
@@ -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 %}
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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' %}
|
||||
@@ -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' %}
|
||||
@@ -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
Reference in new issue
Block a user