[doc] Add pages for all supported language

This commit is contained in:
Andreas Dangel
2023-09-01 12:13:56 +02:00
parent ca40dc41b0
commit 107b8e5b67
37 changed files with 277 additions and 56 deletions

View File

@ -409,6 +409,32 @@ entries:
- title: Apex - title: Apex
url: /pmd_languages_apex.html url: /pmd_languages_apex.html
output: web, pdf 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 - title: Java
url: /pmd_languages_java.html url: /pmd_languages_java.html
output: web, pdf output: web, pdf
@ -418,30 +444,57 @@ entries:
- title: JSP - title: JSP
url: /pmd_languages_jsp.html url: /pmd_languages_jsp.html
output: web, pdf output: web, pdf
- title: Julia
url: /pmd_languages_julia.html
output: web, pdf
- title: Kotlin - title: Kotlin
url: /pmd_languages_kotlin.html url: /pmd_languages_kotlin.html
output: web, pdf 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 - title: PLSQL
url: /pmd_languages_plsql.html url: /pmd_languages_plsql.html
output: web, pdf 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: TSql
url: /pmd_languages_tsql.html
output: web, pdf
- title: Visualforce - title: Visualforce
url: /pmd_languages_visualforce.html url: /pmd_languages_visualforce.html
output: web, pdf output: web, pdf
- title: Velocity Template Language (VTL)
url: /pmd_languages_vm.html
output: web, pdf
- title: XML and XML dialects - title: XML and XML dialects
url: /pmd_languages_xml.html url: /pmd_languages_xml.html
output: web, pdf 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 - title: Developer Documentation
output: web, pdf output: web, pdf
folderitems: folderitems:

View File

@ -1,9 +1,9 @@
<details> <details class="language-info">
<summary>Name: {{include.name}}</summary> <summary>Language Info for {{include.name}}</summary>
<div class="card"> <div class="card">
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
<li class="list-group-item">Implementation: {% jdoc include.implementation %}</li> <li class="list-group-item">Implementation: {% jdoc include.implementation %}</li>
<li class="list-group-item">id: {{include.id}}</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">PMD: {% if include.supports_pmd %}✔️{% else %}❌{% endif %}</li>
<li class="list-group-item">CPD: {% if include.supports_cpd %}✔️{% else %}❌{% endif %}</li> <li class="list-group-item">CPD: {% if include.supports_cpd %}✔️{% else %}❌{% endif %}</li>
</ul> </ul>

View File

@ -99,10 +99,11 @@ class JDocNamespaceDeclaration < Liquid::Tag
private private
JDOC_NAMESPACE_MAP = "jdoc_nspaces" JDOC_NAMESPACE_MAP = "jdoc_nspaces"
RESERVED_NSPACES = ['ant', 'apex', 'cli', 'core', 'cpp', 'cs', 'dart', 'dist', 'doc', 'fortran', 'go', 'groovy', 'java', RESERVED_NSPACES = ['ant', 'apex', 'cli', 'coco', 'core', 'cpp', 'cs', 'dart', 'dist', 'doc',
'javascript', 'jsp', 'fortran', 'gherkin', 'go', 'groovy', 'html', 'java',
'javascript', 'jsp', 'julia',
'kotlin', 'lang-test', 'lua', 'matlab', 'objectivec', 'perl', 'php', 'plsql', 'python', 'ruby', 'scala', 'swift', '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]} 'modelica', 'visualforce', 'vm', 'xml'].flat_map {|m| [m, "pmd-" + m]}
def self.make_base_namespaces def self.make_base_namespaces

View File

@ -1008,8 +1008,11 @@ span.soft {
} }
@media (min-height: 600px) and (min-width: 990px) { @media (min-height: 600px) and (min-width: 990px) {
/* sticky sidebar for big screens */
#mysidebar { #mysidebar {
position: fixed !important; position: fixed !important;
overflow: scroll;
height: 80%;
} }
} }
@ -1268,3 +1271,7 @@ h4.panel-title {
a.edit-header { a.edit-header {
font-size: 15px; font-size: 15px;
} }
.language-info {
margin: 2em;
}

View File

@ -1,13 +1,13 @@
--- ---
title: Apex support title: Apex support
permalink: pmd_languages_apex.html permalink: pmd_languages_apex.html
author: Clément Fournier
last_updated: September 2023 (7.0.0) last_updated: September 2023 (7.0.0)
author: Clément Fournier
tags: [languages] tags: [languages]
summary: "Apex-specific features and guidance" summary: "Apex-specific features and guidance"
--- ---
{% include language_info.html name='Apex' id='apex' implementation='apex::lang.apex.ApexLanguageModule' supports_pmd='✔️' supports_cpd='✔️' %} {% include language_info.html name='Apex' id='apex' implementation='apex::lang.apex.ApexLanguageModule' supports_pmd=true supports_cpd=true %}
## Metrics framework ## Metrics framework

View File

@ -1,8 +1,12 @@
--- ---
title: Coco title: Coco
permalink: pmd_languages_coco.html permalink: pmd_languages_coco.html
last_updated: September 2023 (7.0.0)
tags: [languages]
--- ---
{% include language_info.html name='Coco' id='coco' implementation='coco::lang.coco.CocoLanguageModule' supports_cpd=true %}
Coco is a modern programming language designed specifically for building event-driven software. Coco is a modern programming language designed specifically for building event-driven software.
It is part of the Coco Platform from <https://cocotec.io/>. It is part of the Coco Platform from <https://cocotec.io/>.

View File

@ -0,0 +1,8 @@
---
title: C/C++
permalink: pmd_languages_cpp.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='C++' id='cpp' implementation='cpp::lang.cpp.CppLanguageModule' supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: C#
permalink: pmd_languages_cs.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='C#' id='cs' implementation='cs::lang.cs.CsLanguageModule' supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: Dart
permalink: pmd_languages_dart.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Dart' id='dart' implementation='dart::lang.dart.DartLanguageModule' supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: Fortran
permalink: pmd_languages_fortran.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Fortran' id='fortran' implementation='fortran::lang.fortran.FortranLanguageModule' supports_cpd=true %}

View File

@ -1,8 +1,12 @@
--- ---
title: Gherkin title: Gherkin
permalink: pmd_languages_gherkin.html permalink: pmd_languages_gherkin.html
last_updated: September 2023 (7.0.0)
tags: [languages]
--- ---
{% include language_info.html name='Gherkin' id='gherkin' implementation='gherkin::lang.gherkin.GherkinLanguageModule' supports_cpd=true %}
The [Gherkin](https://cucumber.io/docs/gherkin/) language is used to define test cases for the 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. [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. The Gherkin syntax is designed to be non-technical, making it human-readable for a wide audience.

View File

@ -0,0 +1,8 @@
---
title: Go
permalink: pmd_languages_go.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Go' id='go' implementation='go::lang.go.GoLanguageModule' supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: Groovy
permalink: pmd_languages_groovy.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Groovy' id='groovy' implementation='groovy::lang.groovy.GroovyLanguageModule' supports_cpd=true %}

View File

@ -1,9 +1,12 @@
--- ---
title: Processing HTML files title: Processing HTML files
permalink: pmd_languages_html.html permalink: pmd_languages_html.html
last_updated: April 2022 (6.45.0) last_updated: September 2023 (7.0.0)
tags: [languages]
--- ---
{% include language_info.html name='HTML' id='html' implementation='html::lang.html.HtmlLanguageModule' supports_pmd=true supports_cpd=true %}
## The HTML language module ## The HTML language module
**Since:** 6.45.0 **Since:** 6.45.0
@ -14,11 +17,9 @@ last_updated: April 2022 (6.45.0)
The HTML language module uses [jsoup](https://jsoup.org/) for parsing. 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 In the Designer, text nodes appear as nodes with name "#text", but they can
be selected as usual using `text()`. 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']]`. so that you have to select attributes by e.g. `//*[@*[local-name() = 'if:true']]`.
Only XPath 1.0 rules are not supported.

View File

@ -2,12 +2,12 @@
title: Java support title: Java support
permalink: pmd_languages_java.html permalink: pmd_languages_java.html
author: Clément Fournier author: Clément Fournier
last_updated: March 2021 (7.0.0) last_updated: September 2023 (7.0.0)
tags: [languages] tags: [languages]
summary: "Java-specific features and guidance" summary: "Java-specific features and guidance"
--- ---
{% include language_info.html name='Java' id='java' implementation='java::lang.java.JavaLanguageModule' supports_pmd='✔️' supports_cpd='✔️' %} {% include language_info.html name='Java' id='java' implementation='java::lang.java.JavaLanguageModule' supports_pmd=true supports_cpd=true %}
{% include warning.html content="WIP, todo for pmd 7" %} {% include warning.html content="WIP, todo for pmd 7" %}

View File

@ -1,10 +1,15 @@
--- ---
title: JavaScript and TypeScript title: JavaScript and TypeScript
permalink: pmd_languages_js_ts.html permalink: pmd_languages_js_ts.html
last_updated: September 2023 (7.0.0)
tags: [languages] tags: [languages]
summary: "JavaScript and TypeScript infos" summary: "JavaScript and TypeScript infos"
--- ---
{% include language_info.html name='JavaScript' id='ecmascript' implementation='javascript::lang.ecmascript.EcmascriptLanguageModule' supports_pmd=true supports_cpd=true %}
{% include language_info.html name='TypeScript' id='ts' implementation='javascript::lang.typescript.TsLanguageModule' supports_cpd=true %}
**JavaScript** support is using [Rhino](https://github.com/mozilla/rhino) for parsing and supports CPD as well as **JavaScript** support is using [Rhino](https://github.com/mozilla/rhino) for parsing and supports CPD as well as
PMD with rules. PMD with rules.

View File

@ -1,11 +1,14 @@
--- ---
title: JSP Support title: JSP Support
permalink: pmd_languages_jsp.html permalink: pmd_languages_jsp.html
author: Pieter Vanraemdonck last_updated: September 2023 (7.0.0)
tags: [languages] tags: [languages]
author: Pieter Vanraemdonck
summary: "JSP-specific features and guidance" summary: "JSP-specific features and guidance"
--- ---
{% include language_info.html name='Java Server Pages' id='jsp' implementation='jsp::lang.jsp.JspLanguageModule' supports_pmd=true supports_cpd=true %}
## What is currently supported and what is not ## What is currently supported and what is not
In short, JSP files that are XHTML-compliant, are supported. In short, JSP files that are XHTML-compliant, are supported.
@ -38,16 +41,3 @@ The XHTML support means that:
further broken down. If you want to create rules that check the code further broken down. If you want to create rules that check the code
inside EL expressions or JSP scriptlets (a.o.), you currently would inside EL expressions or JSP scriptlets (a.o.), you currently would
have to do "manual" string manipulation (e.g. using regular expressions). have to do "manual" string manipulation (e.g. using regular expressions).
## How to use it
Using the command-line interface, two new options can be used in the arguments string:
* "-jsp" : this triggers checking JSP files (they are not checked by default)
* "-nojava" : this tells PMD not to check java source files (they are checked by default)
Using the Ant task, you decide if PMD must check JSP files by choosing
what files are given to the PMD task. If you use a fileset that
contains only ".java" files, JSP files obviously will not be checked.
If you want to call the PMD API for checking JSP files, you should investigate the javadoc of PMD.

View File

@ -1,9 +1,13 @@
--- ---
title: Julia title: Julia
permalink: pmd_languages_julia.html permalink: pmd_languages_julia.html
last_updated: September 2023 (7.0.0)
tags: [languages]
--- ---
The [Julia](https://julialang.org/) is dynamically typed, like a scripting language, {% include language_info.html name='Julia' id='julia' implementation='julia::lang.julia.JuliaLanguageModule' supports_cpd=true %}
The [Julia](https://julialang.org/) language is dynamically typed, like a scripting language,
and has good support for interactive use. and has good support for interactive use.
Julia was designed from the beginning for high performance. Julia was designed from the beginning for high performance.
Julia programs compile to efficient native code for multiple platforms via LLVM. Julia programs compile to efficient native code for multiple platforms via LLVM.

View File

@ -1,10 +1,13 @@
--- ---
title: Kotlin Support title: Kotlin Support
permalink: pmd_languages_kotlin.html permalink: pmd_languages_kotlin.html
last_updated: September 2023 (7.0.0)
tags: [languages] tags: [languages]
summary: "Kotlin-specific features and guidance" summary: "Kotlin-specific features and guidance"
--- ---
{% include language_info.html name='Kotlin' id='kotlin' implementation='kotlin::lang.kotlin.JspLanguageModule' supports_pmd=true supports_cpd=true %}
Kotlin support in PMD is based on the official grammar from <https://github.com/Kotlin/kotlin-spec>. Kotlin support in PMD is based on the official grammar from <https://github.com/Kotlin/kotlin-spec>.
Java-based rules and XPath-based rules are supported. Java-based rules and XPath-based rules are supported.

View File

@ -108,7 +108,7 @@ The Java language can be configured with the following properties:
Environment variable: `PMD_APEX_ROOT_DIRECTORY` Environment variable: `PMD_APEX_ROOT_DIRECTORY`
## VisualForce language properties ## Visualforce language properties
- `apexDirectories`: Comma separated list of directories for Apex classes. Absolute - `apexDirectories`: Comma separated list of directories for Apex classes. Absolute
or relative to the Visualforce directory. Default is `../classes`. Specifying an or relative to the Visualforce directory. Default is `../classes`. Specifying an

View File

@ -0,0 +1,8 @@
---
title: Lua
permalink: pmd_languages_lua.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Lua' id='lua' implementation='lua::lang.lua.LuaLanguageModule' supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: Matlab
permalink: pmd_languages_matlab.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Matlab' id='matlab' implementation='matlab::lang.matlab.MatlabLanguageModule' supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: Modelica
permalink: pmd_languages_modelica.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Modelica' id='modelica' implementation='modelica::lang.modelica.ModelicaLanguageModule' supports_pmd=true supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: Objective-C
permalink: pmd_languages_objectivec.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='objectivec' id='objectivec' implementation='objectivec::lang.objectivec.ObjectiveCLanguageModule' supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: Perl
permalink: pmd_languages_perl.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Perl' id='perl' implementation='perl::lang.perl.PerlLanguageModule' supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: PHP
permalink: pmd_languages_php.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='PHP' id='php' implementation='php::lang.php.PhpLanguageModule' supports_cpd=true %}

View File

@ -1,11 +1,13 @@
--- ---
title: PLSQL Support title: PLSQL Support
permalink: pmd_languages_plsql.html permalink: pmd_languages_plsql.html
last_updated: March 2021 (6.33.0) last_updated: September 2023 (7.0.0)
tags: [languages] tags: [languages]
summary: "PLSQL-specific features and guidance" summary: "PLSQL-specific features and guidance"
--- ---
{% include language_info.html name='PLSQL' id='plsql' implementation='plsql::lang.plsql.PLSQLLanguageModule' supports_pmd=true supports_cpd=true %}
## Parsing Exclusions ## Parsing Exclusions
The grammar for PLSQL used in PMD has several bugs and might not parse all DDL scripts The grammar for PLSQL used in PMD has several bugs and might not parse all DDL scripts
@ -17,9 +19,9 @@ which cause PMD to treat the source in between these comments more or less
like a multi-line comment, or in other words, just not try to parse them. like a multi-line comment, or in other words, just not try to parse them.
It is good practice to include a reason for excluding inside the It is good practice to include a reason for excluding inside the
`-- PMD-EXCUDE-BEGIN` comment separated by a colon. `-- PMD-EXCLUDE-BEGIN` comment separated by a colon.
The `PMD-EXCLUDE-BEGIN` and `PMD-EXLUDE-END` comment lines must not contain The `PMD-EXCLUDE-BEGIN` and `PMD-EXCLUDE-END` comment lines must not contain
other statements, e.g. `do_xy(); -- PMD-EXCLUDE-BEGIN` is invalid. other statements, e.g. `do_xy(); -- PMD-EXCLUDE-BEGIN` is invalid.
Example: Example:

View File

@ -0,0 +1,8 @@
---
title: Python
permalink: pmd_languages_python.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Python' id='python' implementation='python::lang.python.PythonLanguageModule' supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: Ruby
permalink: pmd_languages_ruby.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Ruby' id='ruby' implementation='ruby::lang.ruby.RubyLanguageModule' supports_cpd=true %}

View File

@ -0,0 +1,8 @@
---
title: Scala
permalink: pmd_languages_scala.html
last_updated: September 2023 (7.0.0)
tags: [languages]
---
{% include language_info.html name='Scala' id='scala' implementation='scala::lang.scala.ScalaLanguageModule' supports_pmd=true supports_cpd=true %}

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