.. _Lint Configurations:

Lint Configurations
-------------------


Lint configurations can be saved when starting a new session at the last step of the lint configuration quick pick menu (see :ref:`Start a Linting Session`).

The lint configuration of an active session can be saved by using the **Verissimo: Lint Project...** command and selecting the **Save Current Session Configuration...** option. 

A lint configuration can also be manually defined under the **.dvt** directory in a file with the **.lint.json** extension.
These files can be shared in order to enforce the same lint configurations across teams.

To launch a linting session using a saved configuration use the "Verissimo: Lint Project..." command, select the **Saved Configuration...** option, and chose one a configurations.

To open the saved configuration file use the "Verissimo: Lint Project..." command and select the **Open Current Configuration File** option.

Lint Configuration File Format
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


The lint configuration file contains a JSON object with the following properties:

- **ruleset** - path to the ruleset XML file / name of a predefined ruleset

  - type: string
  - **required**
  - supports relative paths and environment variables
  - supported predefined rulesets: "Basic Rules", "Basic OVM Rules", "RTL Rules", "Dead Code Rules", "UVM IEEE 1800.2-2020 Compliance Rules", "Performance Rules", "UVM Compliance Rules", "OVM Compliance Rules", "All Rules", "All OVM Rules", "Non Standard Rules"

- **waivers** - path to the waivers XML file

  - type: string
  - **optional** (default value = "verissimo_waivers.xml")
  - supports relative paths and environment variables

- **baselineHTMLReport** - path to the baseline HTML report directory

  - type: string
  - **optional** (default value = undefined)
  - supports relative paths and environment variables

- **prewaiveUnchangedFiles** - when true, unchanged files will be pre-waived, compared to the files from the baseline report

  - type: boolean
  - **optional** (default value = false)
  - considered only when a **baselineHTMLReport** is specified

- **autoExportHTMLReport** - triggers the auto export of the HTML Report after every lint operation

  - type: boolean
  - **optional** (default value = false)

- **htmlReportLocation** - path to the HTML Report that should be generated

  - type: string
  - **optional**  (default value = undefined)
  - supports relative paths and environment variables
  - considered only when **autoExportHTMLReport** is set to **true**

- **includeSourcesInHTMLReport** - include the linted source code in the generated HTML report

  - type: boolean
  - **optional**  (default value = false)
  - considered only when **autoExportHTMLReport** is set to **true**


Lint Configuration File Example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: json

  {
  "ruleset": "my_ruleset.xml",
  "waivers": "${WAIVERS_DIR}/verissimo_waivers_1.xml",
  "baselineHTMLReport": "../verissimo_html_report",
  "prewaiveUnchangedFiles": false,
  "htmlReportLocation": "$DVT_HOME",
  "autoExportHTMLReport": true,
  "includeSourcesInHTMLReport": true
  }

.. note::

	Relative paths should be relative to the lint configuration file.

.. note::

	Environment variables should have the following syntax: **${ENV_VAR}** or **$ENV_VAR**.

