<type>documentation</type>
<domain>warnings</domain>
<id>index</id>
<title>Code Warnings Tool</title>
<date>$Date$</date>
<version>$Revision$</version>
<product>pro+</product>

The `Code Warnings <script:show-panel-code-warnings>`__ tool in the ``Tools`` menu lists
all the warnings found on the current editor. Clicking on warnings or pressing the
``Enter`` key in the list navigates to that warning in the editor, highlighting it briefly
with a callout, as configured from the ``Editor > Callouts`` preferences group.

**Disabling Warnings**

The ``Code Warnings`` tool is also used to selectively disable warnings.

Individual warnings may be disabled by clicking on the red ``X`` that appears while moving
the mouse cursor over warnings in the ``Code Warnings`` tool, or by selecting an item and
pressing the ``Delete`` key. When this is done, Wing disables most individual warnings
only for the scope it appears in. However, undefined attribute warnings are always
disabled in all files.

The right-click context menu on the ``Code Warnings`` tool may be used to specify how
widely to disable a warning, either only one specific case, all warnings of that type in
the file, or all warnings of that type in all files.

For `external checkers <ref:warnings/external-checkers>`__, warnings disabled by clicking
the red ``X`` or pressing ``Delete`` are hidden globally by type. Note, however, that Wing
does this without altering the external checker's regular configuration file. Editing the
configuration for the external checker directly, as documented by the external checker, is
another way to ignore some of its errors and warnings.

**Configuration: Disabled Warnings**

When a warning is disabled, Wing adds a rule to the ``Configuration: Disabled Warnings``
page in the drop-down menu at the top of the ``Code Warnings`` tool.

Rules are organized into those defined for the current file and those defined for any
file. Configuration rules may be dragged between these two groups. Rules may be deleted by
clicking on the red ``X`` that appears while moving the mouse cursor over the items, or by
selecting them and pressing the ``Delete`` key.

Rules may be edited from the right-click context menu, in order to disable a broader
or narrower set of warnings. For example, a rule to disable a specific undefined attribute
warning can be changed to disable all undefined attribute warnings for the class by
changing the ``Attribute Name`` field from ``.attribute`` to ``.*``.

**Configuration: Defaults**

The types of code warnings that Wing shows can be configured from the ``Configuration:
Defaults`` page in the drop-down menu at the top of the ``Code Warnings`` tool. The
warnings types Wing supports are documented in `Warning Types
<ref:warnings/warning-types>`__ and some of the warning types offer configuration options
to control which variants of that type of warning will be shown.

**Sharing Configurations**

The current code warnings configuration may be exported to the user settings area,
or to a selected file from the ``Options`` menu in the ``Code Warnings`` tool.  Projects
may then share the configuration through the ``Use Configuration From`` item in the
``Code Warnings`` tool's ``Options`` menu.

When the code warnings configuration is stored in user settings, it is written to a file
named ``code-warnings.conf`` in the `User Settings Directory
<ref:install/user-settings-dir>`__.

When the code warnings configuration is stored to another file, it may be checked into
revision control along with the ``.wpr`` file. The choice of which external configuration
file is used is stored in the ``.wpr`` file so all users of that project will use the same
code warnings configuration. Wing will be able to find the shared configuration as long as
the relative path between the project and the configuration file remains the same.

**Clearing the Configuration**

The code warnings configuration may be reset to blank with the ``Clear Configuration``
item in the ``Code Warnings`` tool's ``Options`` menu.
