forked from phoedos/pmd
Corrections for PR
This commit is contained in:
parent
cbfd39b7ca
commit
5da6525276
@ -9,4 +9,4 @@ allowed-tags:
|
||||
- metrics # About using metrics, and metrics indices
|
||||
- tools # About tools and integrations, Maven, gradle, etc.
|
||||
- devdocs # About PMD internals, contributing, building, projects
|
||||
- languages
|
||||
- languages
|
||||
|
@ -19,4 +19,4 @@
|
||||
<button class="btn btn-primary topical-filter" data-group="{{ include.datagroup }}">Learn More</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -52,4 +52,4 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<link rel="stylesheet" href="{{ "css/lavish-bootstrap.css" }}">
|
||||
<link rel="stylesheet" href="{{ "css/customstyles.css" }}">
|
||||
<link rel="stylesheet" href="{{ "css/theme-blue.css" }}">
|
||||
<link rel="stylesheet" href="{{ " css/pmd-customstyles.css" }}">
|
||||
<link rel="stylesheet" href="{{ "css/pmd-customstyles.css" }}">
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
|
||||
|
@ -59,6 +59,7 @@ module CustomFilters
|
||||
rank_lookup = rank_lookup_from_sidebar(sidebar)
|
||||
|
||||
xs.sort {|x, y|
|
||||
# The default rank is very high so that pages that don't appear in the sidebar are put at the end
|
||||
rx = rank_lookup[x.url] || 10000
|
||||
ry = rank_lookup[y.url] || 10000
|
||||
|
||||
@ -69,4 +70,4 @@ module CustomFilters
|
||||
|
||||
end
|
||||
|
||||
Liquid::Template.register_filter(CustomFilters)
|
||||
Liquid::Template.register_filter(CustomFilters)
|
||||
|
@ -14,16 +14,16 @@ class EvalTag < Liquid::Tag
|
||||
# Lookup allows access to the page/post variables through the tag context
|
||||
def lookup(context, name)
|
||||
lookup = context
|
||||
name.split(".").each {|value|
|
||||
name.strip.split(".").each {|value|
|
||||
lookup = lookup[value]
|
||||
}
|
||||
lookup
|
||||
end
|
||||
|
||||
def render(context)
|
||||
lookup(context, lookup(context, @name_expression).strip)
|
||||
lookup(context, lookup(context, @name_expression))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Liquid::Template.register_tag('eval', EvalTag)
|
||||
Liquid::Template.register_tag('eval', EvalTag)
|
||||
|
@ -10,4 +10,4 @@
|
||||
|
||||
.landing-page.cat-description {
|
||||
margin-top: .4cm;
|
||||
}
|
||||
}
|
||||
|
@ -105,4 +105,4 @@ Like for PMD, CPD is started on Unix by `run.sh cpd` and on Windows by `cpd.bat`
|
||||
There are two required parameters:
|
||||
* `--files <path>`: path to the sources to analyse. This can be a file name, a
|
||||
directory or a jar or zip file containing the sources.
|
||||
* `--minimum-tokens <number>`: the minimum token length which should be reported as a duplicate.
|
||||
* `--minimum-tokens <number>`: the minimum token length which should be reported as a duplicate.
|
||||
|
@ -140,7 +140,7 @@ A message placed after the NOPMD marker will get placed in the report, e.g.:
|
||||
|
||||
## XPath and Regex message suppression
|
||||
|
||||
If a particular rule fails consistently in a particular context, you can fall
|
||||
If a particular rule consistently reports a warning in a particular context, you can fall
|
||||
back to disabling the rule for all these contexts using one of two rule properties
|
||||
that are defined on every rule. Depending on what you're after, you can suppress
|
||||
violations for **specific messages** using regular expressions, or **specific nodes**
|
||||
@ -168,10 +168,14 @@ a regular expression that matches the message of violations you wish to
|
||||
suppress. Regular expressions are explained in the JavaDoc for standard
|
||||
Java class java.util.regex.Pattern.
|
||||
|
||||
This technique of course relies on how the rule's message is implemented.
|
||||
Some rules always report the same message, in which case this property is
|
||||
of no use.
|
||||
|
||||
### The property `violationSuppressXPath`
|
||||
|
||||
This property defines an XPath query to be executed using the
|
||||
violation node as the starting point. If the XPath query matches anything,
|
||||
This property defines an XPath query to be executed *using the
|
||||
violation node as the starting point*. If the XPath query matches anything,
|
||||
then the violation will be suppressed.
|
||||
|
||||
For example, to suppress reporting specifically typed parameters which are unused:
|
||||
@ -185,6 +189,4 @@ For example, to suppress reporting specifically typed parameters which are unuse
|
||||
Note for XPath based suppression to work, you must know how to write
|
||||
an XPath query that matches the AST structure of the nodes of the
|
||||
violations you wish to suppress. XPath queries are explained in
|
||||
[XPath Rule tutorial](pmd_userdocs_extending_writing_xpath_rules.html).
|
||||
|
||||
Suggestions? Comments? Post them [here](https://github.com/pmd/pmd/issues). Thanks!
|
||||
[XPath Rule tutorial](pmd_userdocs_extending_writing_xpath_rules.html).
|
Loading…
x
Reference in New Issue
Block a user