Waivers Tab
The waivers tab can be used to add, remove, edit and inspect waivers and pre-waivers.
There are three types of waivers:
Manually defined waivers
Manually defined pre-waivers
Inline waivers (collected from code)
Waivers are used to change the status of the failures or remove the failures that are matched. Pre-waivers are used to exclude files from linting, therefore reducing the total linting time.
Waivers Editor
Manually defined waivers can be created using New… button from the Waivers tab. The Lint Waivers Editor dialog offers an easy way to configure a waiver. The parameters that can be configured are:
File: the file where the waiver will be saved (from the waivers include tree)
Name: an unique name for the waiver
Description: a short explanation for the waiver
Status: the status that will be applied to the matched failures
Apply on: the scope of the waiver (it applies on matched or non matched failures)
Paths: the file paths on which this waiver applies to
Check Names: the name of the checks this waiver applies to
Message Patterns: the regular expression this waiver must match (Perl-like or simple regular expression)
Line Ranges: the line, or line ranges (StartLine:EndLine) this waiver must match
Elements: the elements used to obtain a set of files that will be waived; files containing only such elements and all the files included in the scope of those elements will be waived
The status option can be set to:
DISABLED: failures are removed
ERROR: failures are reported as errors
WARNING: failures are reported as warnings
INFO: failures are reported as info
The waiver will match a failure if all defined parameters match the failure properties (the check that generated the failure, line, file, or message). If a parameter is empty (not defined) it will match any value.
Pre-Waivers Editor
Manually defined pre-waivers can be created using New… button from the Waivers tab and setting the Waiver Type to PRE-WAIVER. The parameters that can be configured are:
File: the file where the pre-waiver will be saved (from the waivers include tree)
Name: an unique name for the pre-waiver
Description: a short explanation for the pre-waiver
Apply on: the scope of the pre-waiver (it applies on matched or non matched paths)
Paths: the paths on which this waiver applies to
Check Names: the name of the checks this pre-waiver applies to
Elements: the elements used to obtain a set of files that will be pre-waived; files containing only such elements and all the files included in the scope of those elements will be pre-waived
Inline Waivers Editor
Lint waivers can be extracted from user comments containing a specific pragma.
code line 1
code line 2
// @DVT_LINTER_WAIVER_START "#NAME#" "#DESCRIPTION#" #STATUS# #CHECKS#
code line 4
...
code line 7
// @DVT_LINTER_WAIVER_END "#NAME#"
code line 8
code line 10 // @DVT_LINTER_WAIVER "#NAME#" "#DESCRIPTION#" #STATUS# #CHECKS#
code line 11
code line 12 /* @DVT_LINTER_WAIVER "#NAME#" "#DESCRIPTION#" #STATUS# #CHECKS# */ // inline comment
code line 13 /* @DVT_LINTER_WAIVER "#NAME#" "#DESCRIPTION#" #STATUS# #CHECKS# */ /* @DVT_LINTER_WAIVER "#NAME#" "#DESCRIPTION#" #STATUS# #CHECKS# */ // inline comment
Parameters:
#NAME#
Must be an unique id of a waiver
It is optional; if not defined, a default name containing file and line is used
#DESCRIPTION#
Used in GUI as a description box for the waiver
It is optional; if not defined, a default description containing file and line is used
#STATUS#
Any value from the following set of values (mandatory)
error : hits matched by this waiver will be reported as errors
warning : hits matched by this waiver will be reported as warnings
info : hits matched by this waiver will be reported as infos
disable : hits matched by this waiver will not be stored
If two or more waivers cover the same piece of code they will apply in the order they were declared.
Inline waivers are applied before file waivers
#CHECKS#
Is a comma separated list of check names
Note
Inline waivers are applied only on failures in the same file where they were declared.
The failures in files included between begin and end of a waiver are not affected by the waiver.
The begin/end of multiline waivers must always be in the same file.
The multiline waivers can be interlaced by using names for start and end pragmas.
The inline waivers must be inserted before inline comments as block comments, otherwise they will not be identified.
Manually defined inline waivers can be created selecting Add Code Waiver for Failure option when right-clicking on a failure in Checks Tab. The parameters that can be configured are:
Comment type: the type of comment that will be inserted in code
Name: an unique name for the waiver
Description: a short explanation for the waiver
Status: the status that will be applied to the matched failures
Check Names: the name of the checks this waiver applies to
Insert Check Names button: opens a dialog with checks available in current linting session; those selected will be added to the waiver
Line Ranges: the line, or line range (StartLine:EndLine) this waiver must match
Waive Entire File button: replaces the current line or line range with a line range covering the entire file