You can use waivers to change the severity (promote/demote) or disable the problems reported by DVT during compilation.
Waivers are applied in order.
Multiple waivers may be applied to the same problem.
Waivers are defined in the
.dvt/waivers.xml file.
To quickly create waivers use the
"DVT: Create New Waiver..." command or invoke the
"Quick Fix..." command on an existing error and pick the
"Waive ... error" proposal.
You can
include other waiver files using:
<include path="/path/to/included_waivers.xml"/>
The path can be absolute or relative to the project root and can use environment variables.
Compile Waivers Examples
Each problem message is in the form:
<CHECK_ID>: <Failure Details>
or, for
Non-top files:
_<CHECK_ID>: <Failure Details>
See
Semantic Checks for a complete list of all checks and their identifiers.
This allows you to change the severity by check id using a waiver like:
<waiver name="Disable all <CHECK_ID>" severity="DISABLED"><match message="*<CHECK_ID>:*"/>
Compile Waivers File Syntax (XML)
<!--
XML file header; required.
-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE waivers PUBLIC "-//DVT//waivers" "waivers.dtd" >
<!--
Root tag; required.
Version attribute is required.
The latest syntax version, illustrated by this example, is version 1.
-->
<waivers version="1">
<!--
You can include waivers from other waiver files. The syntax
of the included files is the same as this. You may use environment
variables in the path to included waiver files.
-->
<include path="$COMMON/path/to/included_waivers.xml"/>
<!--
The waiver tag must specify the NEW severity of the problems
waived by this waiver; it can be one of ERROR, WARNING, DISABLED or DEFAULT.
-->
<waiver name="Optional short name of the waiver" severity="DISABLED">
<description>An optional verbose description of the waiver.</description>
<!--
Each waiver must contain at least one match tag.
Each match tag can specify any combination of the following attributes: message pattern, path pattern, default-severity.
Any omitted attribute is implicitly matched.
A match tag without any attributes will match all problems.
A match tag matches a problem if ALL specified patterns and the default-severity match.
The waiver will waive a problem if ANY of the match tags matches.
NOTE:
path pattern is matched against the problem's full path (NOT the project relative path)
default-severity is matched against the problem's initial reported severity
patterns may contain * or ? wildcards
-->
<match
message="pattern to match against the problem's message"
path="/pattern/to/match/against/the/problems/absolute/path"/>
<match message="*message pattern*" path="/path/pattern*"/>
<match message="*only by message*"/>
<match path="/only/by/path*"/>
<match path="/all/warnings/in/path/*" default-severity="WARNING"/>
</waiver>
<!-- Further example waivers -->
<waiver name="Disable by message" severity="DISABLED">
<description>
This waiver disables all problems containing 'JUST_A_FOO_PROBLEM'
inside their message.
</description>
<match message="*JUST_A_FOO_PROBLEM*"/>
</waiver>
<waiver name="Demote by path" severity="WARNING">
<description>
This waiver turns into warnings all problems reported
under '/path/to/foo'
</description>
<match path="/path/to/foo/*"/>
</waiver>
<waiver name="Promote by path OR message" severity="ERROR">
<description>
This waiver turns into errors all problems that
contain 'JUST_A_FOO_PROBLEM' inside their message OR were reported
under '/path/to/foo'.</description>
<match message="*JUST_A_FOO_PROBLEM*"/>
<match path="/path/to/foo/*"/>
</waiver>
<waiver name="Disable by path AND message" severity="DISABLED">
<description>
This waiver disables all problems that contain 'JUST_A_FOO_PROBLEM'
inside their message AND were reported
under '/path/to/foo'.</description>
<match message="*JUST_A_FOO_PROBLEM*" path="/path/to/foo/*"/>
</waiver>
</waivers>
NOTE: Backslashes '\' are always treated as path separators, regardless of the OS. Therefore, you cannot use '\?' and '\*' to escape wildcards.