.. _Compile Waivers:

Compile Waivers
===============

.. rst-class:: lead

You can use waivers to change the severity (promote/demote) or disable the problems reported by DVT during compilation.

.. list-table::
   :header-rows: 0
   :widths: auto

   * - **Promote**
     - Warning -> Error
   * - **Demote**
     - Error -> Warning
   * - **Disable**
     - Hide
   * - **Restore**
     - Restore a waived problem to its default (originally reported) severity


Waivers are applied in order.
Multiple waivers may be applied to the same problem.


Waivers are defined per project, in the **.dvt/waivers.xml** file.

For more flexibility, on top of the project level compilation waivers, DVT allows you to use compilation waiver files specific to a build configuration. To do that, simply add in the build configuration file the ``+dvt_compile_waivers_file+`` directive followed by the path to the desired file.

To quickly create a waivers file click on the **Edit waivers** button in the |problems-view|. The **.dvt/waivers.xml** is created with a default content and opened. You can easily create your own waivers from the default generated ones. In the waivers editor you can use autocomplete for tags, attributes and attribute values.

To quickly create a new waiver, in the |problems-view| right click on any problem reported by DVT and waive it. DVT proposes some default values for the waiver file, description, path and message. You can easily change them to fine-tune the waiver.

Another easy way to create a new waiver right from the editor is by using |waive-compilation-problems|.

You can **include** other waiver files using:

.. code-block::

    <include path="/path/to/included_waivers.xml"/>
 
The path can be absolute or relative to the project root, and can use environment variables.

.. include:: compile-waivers-syntax-and-examples.rst
