Skip to content

Commit

Permalink
Merge branch 'master' into jdk-18
Browse files Browse the repository at this point in the history
  • Loading branch information
adangel committed Mar 25, 2022
2 parents 19cba36 + 522605d commit 60ae36b
Show file tree
Hide file tree
Showing 41 changed files with 1,634 additions and 467 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -6566,6 +6566,15 @@
"contributions": [
"bug"
]
},
{
"login": "btjiong",
"name": "Bailey Tjiong",
"avatar_url": "https://avatars.githubusercontent.com/u/15816011?v=4",
"profile": "https://github.com/btjiong",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
9 changes: 5 additions & 4 deletions .ci/files/project-list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ mvn dependency:build-classpath -DincludeScope=test -Dmdep.outputFile=classpath.t
<exclude-pattern>.*/build/generated-sources/.*</exclude-pattern>

<build-command><![CDATA[#!/usr/bin/env bash
if test -e classpath.txt; then
exit
fi
set -e
# Make sure to use java11. This is already installed by build.sh
Expand Down Expand Up @@ -132,6 +128,11 @@ index 6021fa574d..15d29ed699 100644
EOF
) | patch --strip=1
## Skip gradle execution
if test -e classpath.txt; then
exit
fi
./gradlew --console=plain --build-cache --no-daemon --max-workers=4 build testClasses -x test -x javadoc -x api -x asciidoctor -x asciidoctorPdf
./gradlew --console=plain --build-cache --no-daemon --max-workers=4 createSquishClasspath -q > classpath.txt
]]></build-command>
Expand Down
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
3 changes: 3 additions & 0 deletions docs/_data/sidebars/pmd_sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ entries:
- title: Visualforce
url: /pmd_languages_visualforce.html
output: web, pdf
- title: XML and XML dialects
url: /pmd_languages_xml.html
output: web, pdf
- title: Developer Documentation
output: web, pdf
folderitems:
Expand Down
83 changes: 76 additions & 7 deletions docs/_data/xpath_funs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,93 @@ aliases:
type: "xs:string"
description: "The qualified name of a Java class, possibly with pairs of brackets to indicate an array type.
Can also be a primitive type name."
- &node_param
name: element
type: "xs:element"
description: "Any element node"
- &needs_typenode "The context node must be a {% jdoc jast::TypeNode %}"
- &coord_fun_note |
The function is not context-dependent, but takes a node as its first parameter.
The function is only available in XPath 2.0.
- &needs_node_ctx "The requires the context node to be an element"

langs:
- name: "Any language"
- name: "All languages"
ns: "pmd"
header: "Functions available to all languages are in the namespace `pmd`."
funs:
- name: fileName
returnType: "xs:string"
shortDescription: "Returns the current filename"
description: "Returns the current simple filename without path but including the extension.
This can be used to write rules that check filename naming conventions.
<p>This function is available since PMD 6.38.0.</p>"
notes: "The function can be called on any node."
shortDescription: "Returns the simple name of the current file"
description: |
Returns the current simple file name, without path but including the extension.
This can be used to write rules that check file naming conventions.
since: 6.38.0
notes: *needs_node_ctx
examples:
- code: "//b[pmd:fileName() = 'Foo.xml']"
outcome: "Matches any `&lt;b&gt;` tags in files called `Foo.xml`."

- name: startLine
returnType: "xs:int"
parameters:
- *node_param
shortDescription: "Returns the start line of the given node"
description: |
Returns the line where the node starts in the source file.
Line numbers are 1-based.
since: 6.44.0
notes: *coord_fun_note
examples:
- code: "//b[pmd:startLine(.) > 5]"
outcome: "Matches any `&lt;b&gt;` node which starts after the fifth line."

- name: endLine
returnType: "xs:int"
parameters:
- *node_param
shortDescription: "Returns the end line of the given node"
description: |
Returns the line where the node ends in the source file.
Line numbers are 1-based.
since: 6.44.0
notes: *coord_fun_note
examples:
- code: "//b[pmd:endLine(.) == pmd:startLine(.)]"
outcome: "Matches any `&lt;b&gt;` node which doesn't span more than one line."

- name: startColumn
returnType: "xs:int"
parameters:
- *node_param
shortDescription: "Returns the start column of the given node (inclusive)"
description: |
Returns the column number where the node starts in the source file.
Column numbers are 1-based. The start column is inclusive.
since: 6.44.0
notes: *coord_fun_note
examples:
- code: "//b[pmd:startColumn(.) = 1]"
outcome: "Matches any `&lt;b&gt;` node which starts on the first column of a line"

- name: endColumn
returnType: "xs:int"
parameters:
- *node_param
shortDescription: "Returns the end column of the given node (exclusive)"
description: |
Returns the column number where the node ends in the source file.
Column numbers are 1-based. The end column is exclusive.
since: 6.44.0
notes: *coord_fun_note
examples:
- code: "//b[pmd:startLine(.) = pmd:endLine(.) and pmd:endColumn(.) - pmd:startColumn(.) = 1]"
outcome: "Matches any `&lt;b&gt;` node which spans exactly one character"

- name: "Java"
ns: "pmd-java"
Expand Down
8 changes: 8 additions & 0 deletions docs/_includes/custom/xpath_fun_doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

### {{ lang.name }}

{% if lang.header %}
{{ lang.header | render_markdown }}
{% else %}
{{ lang.name }} functions are in the namespace `{{ lang.ns }}`.
{% endif %}

<div class="table-responsive">
<table width="100%">
Expand Down Expand Up @@ -50,6 +54,10 @@ <h4 class="fun-details-header" id="{{ fun_id }}">

<dl>
<dd>{{ fun.description | render_markdown }}</dd>
{% if fun.since %}
<dt>Since</dt>
<dd>PMD {{ fun.since }}</dd>
{% endif %}
<dt>Remarks</dt>
<dd>{{ fun.notes | render_markdown }}</dd>

Expand Down
35 changes: 28 additions & 7 deletions docs/_includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
<footer>
<div class="row">
<div class="col-lg-12 footer">
&copy;{{ site.time | date: "%Y" }} {{site.company_name}}. All rights reserved. <br />
{% if page.last_updated %}<span>Page last updated:</span> {{page.last_updated}}<br/>{% endif %} Site last generated: {{ site.time | date: "%b %-d, %Y" }} <br />
<p><img src="{{ "images/pmd-logo-small.png" }}" alt="Company logo"/></p>
</div>
</div>
{% if site.github_editme_path and page.editmepath != false %}
<hr />
<div>
This documentation is written in markdown. <br />
If there is something missing or can be improved, edit this page on
github and create a PR:
<a
target="_blank"
href="https://github.com/{{site.github_editme_path}}{{editmepath}}"
role="button"
><i class="fa fa-github fa-lg"></i> Edit on GitHub</a
>
</div>
{% endif %}
<hr />
<div class="row">
<div class="col-lg-12 footer">
&copy;{{ site.time | date: "%Y" }} {{site.company_name}}. All rights
reserved. <br />
{% if page.last_updated %}<span>Page last updated:</span>
{{page.last_updated}}<br />{% endif %} Site last generated: {{
site.time | date: "%b %-d, %Y" }} <br />
<p>
<img src="{{ "images/pmd-logo-small.png" }}" alt="Company
logo"/>
</p>
</div>
</div>
</footer>
23 changes: 23 additions & 0 deletions docs/_includes/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<header>
<div class="row">
<div class="col-lg-12">
<a href="./" role="button"
><i class="fa fa-home fa-lg"></i
></a>
» {{page.title}} {% if site.github_editme_path %} {% assign
editmepath = page.path %} {% if page.editmepath %} {% assign
editmepath = page.editmepath %} {% endif %}{% unless page.editmepath
== false %}
<a
target="_blank"
href="https://github.com/{{site.github_editme_path}}{{editmepath}}"
class="pull-right"
role="button"
><i class="fa fa-github fa-lg"></i> Edit on GitHub</a
>
{% endunless %} {% endif %}
</div>
</div>

<hr />
</header>
12 changes: 0 additions & 12 deletions docs/_includes/toc.html

This file was deleted.

2 changes: 1 addition & 1 deletion docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
{% unless page.toc == false %}
<!-- Sticky TOC column -->
<div class="toc-col">
{% include toc.html %}
<div id="toc"></div>
</div>
{% endunless %}
<!-- /.toc-container-wrapper -->
Expand Down
21 changes: 4 additions & 17 deletions docs/_layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
layout: default
---

{% include header.html %}

<div class="post-header">
<h1 class="post-title-main">{{ page.title }}</h1>
</div>
Expand All @@ -28,27 +30,13 @@ <h1 class="post-title-main">{{ page.title }}</h1>

{% endif %}

<div class="post-content">
<div class="post-content" {% if site.github_editme_path and page.editmepath != false %}data-github-edit-url="https://github.com/{{site.github_editme_path}}{{editmepath}}"{% endif %}>

{% if page.summary %}
<div class="summary">{{page.summary}}</div>
{% endif %}

<div id="inline-toc"><!-- empty, move TOC here when screen size too small --></div>


{% if site.github_editme_path %}

{% assign editmepath = page.path %}
{% if page.editmepath %}
{% assign editmepath = page.editmepath %}
{% endif %}
{% unless page.editmepath == false %}
<a target="_blank" href="https://github.com/{{site.github_editme_path}}{{editmepath}}" class="btn btn-default githubEditButton" role="button"><i class="fa fa-github fa-lg"></i> Edit me</a>
{% endunless %}

{% endif %}


{{content}}

<div class="tags">
Expand All @@ -67,6 +55,5 @@ <h1 class="post-title-main">{{ page.title }}</h1>

</div>

{{site.data.alerts.hr_shaded}}

{% include footer.html %}

0 comments on commit 60ae36b

Please sign in to comment.