Skip to content

Commit

Permalink
[DOCs][Updated] Check fields
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Jul 15, 2024
1 parent b18cd39 commit 2385c5d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/samples/generic_plot.kibot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ preflight:
annotate_power: true
# [dict|list(dict)=[]] Checks to apply to the schematic fields.
# You can define conditions that must be met by the fields.
# The checks are applied to every component in the schematic.
# When an error is hit execution is stopped.
# One use is to check that all components are suitable for a temperature range.
# In this case a field must declare the temperature range.
check_fields:
Expand Down
18 changes: 15 additions & 3 deletions docs/source/configuration/sup_preflights.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,32 @@ Supported preflights

- **check_fields** :index:`: <pair: preflight - check_fields; check_fields>` [:ref:`dict <dict>` | :ref:`list(dict) <list(dict)>`] (default: ``[]``) Checks to apply to the schematic fields.
You can define conditions that must be met by the fields.
The checks are applied to every component in the schematic.
When an error is hit execution is stopped.
One use is to check that all components are suitable for a temperature range.
In this case a field must declare the temperature range.

- Valid keys:

- **field** :index:`: <pair: preflight - check_fields - check_fields; field>` [:ref:`string <string>`] (default: ``''``) Name of field to check.
- **regex** :index:`: <pair: preflight - check_fields - check_fields; regex>` [:ref:`string <string>`] (default: ``''``) Regular expression to match the field content.
- **regex** :index:`: <pair: preflight - check_fields - check_fields; regex>` [:ref:`string <string>`] (default: ``''``) Regular expression to match the field content. Note that technically we do a search, not a match.
- *regexp* :index:`: <pair: preflight - check_fields - check_fields; regexp>` Alias for regex.
- ``numeric_condition`` :index:`: <pair: preflight - check_fields - check_fields; numeric_condition>` [:ref:`string <string>`] (default: ``'none'``) (choices: ">", ">=", "<", "<=", "=", "none") Convert the group 1 of the regular expression to a number and apply this operation
to the *numeric_reference* value.
- ``numeric_reference`` :index:`: <pair: preflight - check_fields - check_fields; numeric_reference>` [:ref:`number <number>`] (default: ``0``) Value to compare using *numeric_condition*.
- ``severity`` :index:`: <pair: preflight - check_fields - check_fields; severity>` [:ref:`string <string>`] (default: ``'error'``) (choices: "error", "warning", "info", "skip") If the regex matches what we do.
- ``severity`` :index:`: <pair: preflight - check_fields - check_fields; severity>` [:ref:`string <string>`] (default: ``'error'``) (choices: "error", "warning", "info", "skip", "continue") Default severity applied to various situations.
The *error* will stop execution.
- ``skip_if_missing`` :index:`: <pair: preflight - check_fields - check_fields; skip_if_missing>` [:ref:`boolean <boolean>`] (default: ``true``) If the field is missing we just continue. Otherwise we apply the *severity*.
The *warning* and *info* will generate a message and continue with the rest of the tests.
In the *skip* case we jump to the next component.
Use *continue* to just skip this test and apply the rest.
- ``severity_fail_condition`` :index:`: <pair: preflight - check_fields - check_fields; severity_fail_condition>` [:ref:`string <string>`] (default: ``'default'``) (choices: "error", "warning", "info", "skip", "continue", "default") What to do when the *numeric_condition* isn't met.
Default means to use the *severity* option.
- ``severity_missing`` :index:`: <pair: preflight - check_fields - check_fields; severity_missing>` [:ref:`string <string>`] (default: ``'continue'``) (choices: "error", "warning", "info", "skip", "continue", "default") What to do if the field isn't defined.
Default means to use the *severity* option.
- ``severity_no_match`` :index:`: <pair: preflight - check_fields - check_fields; severity_no_match>` [:ref:`string <string>`] (default: ``'default'``) (choices: "error", "warning", "info", "skip", "continue", "default") What to do when the regex doesn't match.
Default means to use the *severity* option.
- ``severity_no_number`` :index:`: <pair: preflight - check_fields - check_fields; severity_no_number>` [:ref:`string <string>`] (default: ``'default'``) (choices: "error", "warning", "info", "skip", "continue", "default") What to do if we don't get a number for a *numeric_condition*.
Default means to use the *severity* option.


- **check_zone_fills** :index:`: <pair: preflight - check_zone_fills; check_zone_fills>` [:ref:`boolean <boolean>`] Zones are filled before doing any operation involving PCB layers.
Expand Down

0 comments on commit 2385c5d

Please sign in to comment.