KiBot/docs/build/html/configuration/preflight.html

397 lines
34 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>The preflight section &mdash; KiBot 1.6.4 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Default global options" href="global.html" />
<link rel="prev" title="The header" href="header.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home">
KiBot
<img src="../_static/kibot_370x200.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../configuration.html">Configuration</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="quick_start.html">Quick start</a></li>
<li class="toctree-l2"><a class="reference internal" href="section_order.html">Section order</a></li>
<li class="toctree-l2"><a class="reference internal" href="header.html">The header</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">The <em>preflight</em> section</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#supported-preflights">Supported preflights</a></li>
<li class="toctree-l3"><a class="reference internal" href="#more-about-pcb-replace-and-sch-replace">More about <em>pcb_replace</em> and <em>sch_replace</em></a></li>
<li class="toctree-l3"><a class="reference internal" href="#filtering-drc-and-erc-errors">Filtering DRC and ERC errors</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="global.html">Default global options</a></li>
<li class="toctree-l2"><a class="reference internal" href="filters.html">Filters and variants</a></li>
<li class="toctree-l2"><a class="reference internal" href="outputs.html">The <em>outputs</em> section</a></li>
<li class="toctree-l2"><a class="reference internal" href="substitution.html">Doing YAML substitution or preprocessing</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../usage.html">Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usage_with_ci_cd.html">Usage for CI/CD</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Notes and extra information:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../notes_gerber.html">Notes about Gerber format</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes_position.html">Notes about the position file</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes_3d.html">Notes about 3D models</a></li>
<li class="toctree-l1"><a class="reference internal" href="../propose.html">Proposed advanced KiCad usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="../KiPlotYAML.html">KiPlot YAML</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Final notes:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../credits.html">Credits</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Indices and tables:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../genindex.html">Index</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">KiBot</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../configuration.html">Configuration</a></li>
<li class="breadcrumb-item active">The <em>preflight</em> section</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="the-preflight-section">
<span id="index-0"></span><h1>The <em>preflight</em> section<a class="headerlink" href="#the-preflight-section" title="Permalink to this heading"></a></h1>
<p>This section is used to specify tasks that will be executed before
generating any output.</p>
<span class="target" id="index-1"></span><section id="supported-preflights">
<h2>Supported preflights<a class="headerlink" href="#supported-preflights" title="Permalink to this heading"></a></h2>
<ul class="simple">
<li><p><strong>annotate_pcb</strong>: <span class="target" id="index-2"></span>: [dict] Annotates the PCB according to physical coordinates.
This preflight modifies the PCB and schematic, use it only in revision control environments. <br/>
Used to assign references according to footprint coordinates. <br/>
The project must be fully annotated first.</p>
<ul>
<li><p>Valid keys:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">bottom_main_ascending</span></code> <span class="target" id="index-3"></span>: [boolean=true] Sort the main axis in ascending order for the bottom layer.
For X this is left to right and for Y top to bottom.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bottom_main_axis</span></code> <span class="target" id="index-4"></span>: [string=y] [x,y] Use this axis as main sorting criteria for the bottom layer.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bottom_secondary_ascending</span></code> <span class="target" id="index-5"></span>: [boolean=true] Sort the secondary axis in ascending order for the bottom layer.
For X this is left to right and for Y top to bottom.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">bottom_start</span></code> <span class="target" id="index-6"></span>: [number=101] First number for references at the bottom layer.
Use -1 to continue from the last top reference.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">grid</span></code> <span class="target" id="index-7"></span>: [number=1.0] Grid size in millimeters.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">top_main_ascending</span></code> <span class="target" id="index-8"></span>: [boolean=true] Sort the main axis in ascending order for the top layer.
For X this is left to right and for Y top to bottom.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">top_main_axis</span></code> <span class="target" id="index-9"></span>: [string=y] [x,y] Use this axis as main sorting criteria for the top layer.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">top_secondary_ascending</span></code> <span class="target" id="index-10"></span>: [boolean=true] Sort the secondary axis in ascending order for the top layer.
For X this is left to right and for Y top to bottom.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">top_start</span></code> <span class="target" id="index-11"></span>: [number=1] First number for references at the top layer.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">use_position_of</span></code> <span class="target" id="index-12"></span>: [string=footprint] [footprint,reference] Which coordinate is used.</p></li>
</ul>
</li>
</ul>
</li>
<li><p><strong>annotate_power</strong>: <span class="target" id="index-13"></span>: [boolean=false] Annotates all power components.
This preflight modifies the schematic, use it only in revision control environments. <br/>
Used to solve ERC problems when using filters that remove power reference numbers.</p></li>
<li><p><strong>check_zone_fills</strong>: <span class="target" id="index-14"></span>: [boolean=false] Zones are filled before doing any operation involving PCB layers.
The original PCB remains unchanged. If you need to abort when the zone fill
creates significant changes to a layer use the CheckZoneFill internal template.</p></li>
<li><p><strong>erc_warnings</strong>: <span class="target" id="index-15"></span>: [boolean=false] Option for <cite>run_erc</cite>. ERC warnings are considered errors.</p></li>
<li><p><strong>fill_zones</strong>: <span class="target" id="index-16"></span>: [boolean=false] Fill all zones again and save the PCB.</p></li>
<li><p><strong>filters</strong>: <span class="target" id="index-17"></span>: [list(dict)] A list of entries to filter out ERC/DRC messages.
Note that ignored errors will become KiBot warnings (i.e. <cite>(W058) …</cite>). <br/>
To farther ignore these warnings use the <cite>filters</cite> option in the <cite>global</cite> section.</p>
<ul>
<li><p>Valid keys:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">error</span></code> <span class="target" id="index-18"></span>: [string=] Error id we want to exclude.
A name for KiCad 6 or a number for KiCad 5, but always a string.</p></li>
<li><p><em>error_number</em> <span class="target" id="index-19"></span>: Alias for number.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">filter</span></code> <span class="target" id="index-20"></span>: [string=] Name for the filter, for documentation purposes.</p></li>
<li><p><em>filter_msg</em> <span class="target" id="index-21"></span>: Alias for filter.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">number</span></code> <span class="target" id="index-22"></span>: [number=0] Error number we want to exclude.
KiCad 5 only.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">regex</span></code> <span class="target" id="index-23"></span>: [string=] Regular expression to match the text for the error we want to exclude.</p></li>
<li><p><em>regexp</em> <span class="target" id="index-24"></span>: Alias for regex.</p></li>
</ul>
</li>
</ul>
</li>
<li><p><strong>ignore_unconnected</strong>: <span class="target" id="index-25"></span>: [boolean=false] Option for <cite>run_drc</cite>. Ignores the unconnected nets. Useful if you didnt finish the routing.
It will also ignore KiCad 6 warnings.</p></li>
<li><p><strong>pcb_replace</strong>: <span class="target" id="index-26"></span>: [dict] Replaces tags in the PCB. I.e. to insert the git hash or last revision date.
This is useful for KiCad 5, use <cite>set_text_variables</cite> when using KiCad 6. <br/>
This preflight modifies the PCB. Even when a back-up is done use it carefully.</p>
<ul>
<li><p>Valid keys:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">date_command</span></code> <span class="target" id="index-27"></span>: [string=] Command to get the date to use in the PCB.\
<code class="docutils literal notranslate"><span class="pre">`git</span> <span class="pre">log</span> <span class="pre">-1</span> <span class="pre">--format='%as'</span> <span class="pre">--</span> <span class="pre">&quot;$KIBOT_PCB_NAME&quot;`</span></code>\
Will return the date in YYYY-MM-DD format.\
<code class="docutils literal notranslate"><span class="pre">`date</span> <span class="pre">-d</span> <span class="pre">&#64;`git</span> <span class="pre">log</span> <span class="pre">-1</span> <span class="pre">--format='%at'</span> <span class="pre">--</span> <span class="pre">&quot;$KIBOT_PCB_NAME&quot;`</span> <span class="pre">+%Y-%m-%d_%H-%M-%S`</span></code>\
Will return the date in YYYY-MM-DD_HH-MM-SS format.\
Important: on KiCad 6 the title block data is optional.
This command will work only if you have a date in the PCB/Schematic.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">replace_tags</span></code> <span class="target" id="index-28"></span>: [dict|list(dict)] Tag or tags to replace.</p>
<ul>
<li><p>Valid keys:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">after</span></code> <span class="target" id="index-29"></span>: [string=] Text to add after the output of <cite>command</cite>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">before</span></code> <span class="target" id="index-30"></span>: [string=] Text to add before the output of <cite>command</cite>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">command</span></code> <span class="target" id="index-31"></span>: [string=] Command to execute to get the text, will be used only if <cite>text</cite> is empty.
KIBOT_PCB_NAME variable is the name of the current PCB.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">tag</span></code> <span class="target" id="index-32"></span>: [string=] Name of the tag to replace. Use <cite>version</cite> for a tag named <cite>&#64;version&#64;</cite>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">tag_delimiter</span></code> <span class="target" id="index-33"></span>: [string=&#64;] Character used to indicate the beginning and the end of a tag.
Dont change it unless you really know about KiCads file formats.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">text</span></code> <span class="target" id="index-34"></span>: [string=] Text to insert instead of the tag.</p></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><p><strong>run_drc</strong>: <span class="target" id="index-35"></span>: [boolean=false] Runs the DRC (Distance Rules Check). To ensure we have a valid PCB.
The report file name is controlled by the global output pattern (%i=drc %x=txt). <br/>
Note that the KiCad 6+ <em>Test for parity between PCB and schematic</em> option is not supported. <br/>
If you need to check the parity use the <cite>update_xml</cite> preflight. <br/>
KiCad 6 introduced <cite>warnings</cite> they are currently counted be the <cite>unconnected</cite> counter of KiBot. <br/>
This will change in the future.</p></li>
<li><p><strong>run_erc</strong>: <span class="target" id="index-36"></span>: [boolean=false] Runs the ERC (Electrical Rules Check). To ensure the schematic is electrically correct.
The report file name is controlled by the global output pattern (%i=erc %x=txt).</p></li>
<li><p><strong>sch_replace</strong>: <span class="target" id="index-37"></span>: [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date.
This is useful for KiCad 5, use <cite>set_text_variables</cite> when using KiCad 6. <br/>
This preflight modifies the schematics. Even when a back-up is done use it carefully.</p>
<ul>
<li><p>Valid keys:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">date_command</span></code> <span class="target" id="index-38"></span>: [string=] Command to get the date to use in the SCH.\
<code class="docutils literal notranslate"><span class="pre">`git</span> <span class="pre">log</span> <span class="pre">-1</span> <span class="pre">--format='%as'</span> <span class="pre">--</span> <span class="pre">&quot;$KIBOT_SCH_NAME&quot;`</span></code>\
Will return the date in YYYY-MM-DD format.\
<code class="docutils literal notranslate"><span class="pre">`date</span> <span class="pre">-d</span> <span class="pre">&#64;`git</span> <span class="pre">log</span> <span class="pre">-1</span> <span class="pre">--format='%at'</span> <span class="pre">--</span> <span class="pre">&quot;$KIBOT_SCH_NAME&quot;`</span> <span class="pre">+%Y-%m-%d_%H-%M-%S`</span></code>\
Will return the date in YYYY-MM-DD_HH-MM-SS format.\
Important: on KiCad 6 the title block data is optional.
This command will work only if you have a date in the SCH/Schematic.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">replace_tags</span></code> <span class="target" id="index-39"></span>: [dict|list(dict)] Tag or tags to replace.</p>
<ul>
<li><p>Valid keys:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">after</span></code> <span class="target" id="index-40"></span>: [string=] Text to add after the output of <cite>command</cite>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">before</span></code> <span class="target" id="index-41"></span>: [string=] Text to add before the output of <cite>command</cite>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">command</span></code> <span class="target" id="index-42"></span>: [string=] Command to execute to get the text, will be used only if <cite>text</cite> is empty.
KIBOT_SCH_NAME variable is the name of the current sheet.
KIBOT_TOP_SCH_NAME variable is the name of the top sheet.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">tag</span></code> <span class="target" id="index-43"></span>: [string=] Name of the tag to replace. Use <cite>version</cite> for a tag named <cite>&#64;version&#64;</cite>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">tag_delimiter</span></code> <span class="target" id="index-44"></span>: [string=&#64;] Character used to indicate the beginning and the end of a tag.
Dont change it unless you really know about KiCads file formats.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">text</span></code> <span class="target" id="index-45"></span>: [string=] Text to insert instead of the tag.</p></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><p><strong>set_text_variables</strong>: <span class="target" id="index-46"></span>: [dict|list(dict)] Defines KiCad 6 variables.
They are expanded using ${VARIABLE}, and stored in the project file. <br/>
This preflight replaces <cite>pcb_replace</cite> and <cite>sch_replace</cite> when using KiCad 6. <br/>
The KiCad project file is modified.</p>
<ul>
<li><p>Valid keys:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">after</span></code> <span class="target" id="index-47"></span>: [string=] Text to add after the output of <cite>command</cite>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">before</span></code> <span class="target" id="index-48"></span>: [string=] Text to add before the output of <cite>command</cite>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">command</span></code> <span class="target" id="index-49"></span>: [string=] Command to execute to get the text, will be used only if <cite>text</cite> is empty.
This command will be executed using the Bash shell.
Be careful about spaces in file names (i.e. use “$KIBOT_PCB_NAME”).
The <cite>KIBOT_PCB_NAME</cite> environment variable is the PCB file and the
<cite>KIBOT_SCH_NAME</cite> environment variable is the schematic file.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">expand_kibot_patterns</span></code> <span class="target" id="index-50"></span>: [boolean=true] Expand %X patterns. The context is <cite>schematic</cite>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">name</span></code> <span class="target" id="index-51"></span>: [string=] Name of the variable. The <cite>version</cite> variable will be expanded using <cite>${version}</cite>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">text</span></code> <span class="target" id="index-52"></span>: [string=] Text to insert instead of the variable.</p></li>
<li><p><em>variable</em> <span class="target" id="index-53"></span>: Alias for name.</p></li>
</ul>
</li>
</ul>
</li>
<li><p><strong>update_qr</strong>: <span class="target" id="index-54"></span>: [boolean=false] Update the QR codes.
Complements the <cite>qr_lib</cite> output. <br/>
The KiCad 6 files and the KiCad 5 PCB needs manual update, generating a new library isnt enough.</p></li>
<li><p><strong>update_xml</strong>: <span class="target" id="index-55"></span>: [boolean=false|dict] Update the XML version of the BoM (Bill of Materials).
To ensure our generated BoM is up to date. <br/>
Note that this isnt needed when using the internal BoM generator (<cite>bom</cite>). <br/>
You can compare the PCB and schematic netlists using it.</p>
<ul>
<li><p>Valid keys:</p>
<ul>
<li><p><strong>check_pcb_parity</strong> <span class="target" id="index-56"></span>: [boolean=false] Check if the PCB and Schematic are synchronized.
This is equivalent to the <em>Test for parity between PCB and schematic</em> of the DRC dialog.
Only available for KiCad 6+.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">as_warnings</span></code> <span class="target" id="index-57"></span>: [boolean=false] Inform the problems as warnings and dont stop.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">enabled</span></code> <span class="target" id="index-58"></span>: [boolean=true] Enable the update. This is the replacement for the boolean value.</p></li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Here is an example of a <em>preflight</em> section:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">preflight</span><span class="p">:</span>
<span class="w"> </span><span class="nt">run_erc</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">update_xml</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">run_drc</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">check_zone_fills</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">ignore_unconnected</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">false</span>
</pre></div>
</div>
</section>
<section id="more-about-pcb-replace-and-sch-replace">
<span id="index-59"></span><h2>More about <em>pcb_replace</em> and <em>sch_replace</em><a class="headerlink" href="#more-about-pcb-replace-and-sch-replace" title="Permalink to this heading"></a></h2>
<p>These options are supposed to be used in a version control environment.
This is because, unlike other options, they modify the PCB and/or
schematic and might damage them. In a version control environment you
can just roll-back the changes.</p>
<p>Dont be afraid, they make a back-up of the files and also tries to
disable dangerous changes. But should be used carefully. They are ideal
for CI/CD environment where you dont actually commit any changes.</p>
</section>
<section id="filtering-drc-and-erc-errors">
<span id="filter-drc-and-erc"></span><span id="index-60"></span><h2>Filtering DRC and ERC errors<a class="headerlink" href="#filtering-drc-and-erc-errors" title="Permalink to this heading"></a></h2>
<p>Sometimes KiCad reports DRC or ERC errors that you cant get rid off.
This could be just because you are part of a team including lazy people
that doesnt want to take the extra effort to solve some errors that
arent in fact errors, just small violations made on purpose. In this
case you could exclude some known errors.</p>
<p>For this you must declare <code class="docutils literal notranslate"><span class="pre">filters</span></code> entry in the <code class="docutils literal notranslate"><span class="pre">preflight</span></code>
section. Then you can add as many <code class="docutils literal notranslate"><span class="pre">filter</span></code> entries as you want. Each
filter entry has an optional description and defines to which error type
is applied (<code class="docutils literal notranslate"><span class="pre">number</span></code>) and a regular expression that the error must
match to be ignored (<code class="docutils literal notranslate"><span class="pre">regex</span></code>). Like this:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">filters</span><span class="p">:</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">filter</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;Optional</span><span class="nv"> </span><span class="s">filter</span><span class="nv"> </span><span class="s">description&#39;</span>
<span class="w"> </span><span class="nt">error</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;Error_type&#39;</span>
<span class="w"> </span><span class="nt">regex</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;Expression</span><span class="nv"> </span><span class="s">to</span><span class="nv"> </span><span class="s">match&#39;</span>
</pre></div>
</div>
<p>Here is a KiCad 5 example, suppose you are getting the following errors:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">**</span> <span class="n">Found</span> <span class="mi">1</span> <span class="n">DRC</span> <span class="n">errors</span> <span class="o">**</span>
<span class="n">ErrType</span><span class="p">(</span><span class="mi">4</span><span class="p">):</span> <span class="n">Track</span> <span class="n">too</span> <span class="n">close</span> <span class="n">to</span> <span class="n">pad</span>
<span class="o">@</span><span class="p">(</span><span class="mf">177.185</span> <span class="n">mm</span><span class="p">,</span> <span class="mf">78.315</span> <span class="n">mm</span><span class="p">):</span> <span class="n">Track</span> <span class="mf">1.000</span> <span class="n">mm</span> <span class="p">[</span><span class="n">Net</span><span class="o">-</span><span class="p">(</span><span class="n">C3</span><span class="o">-</span><span class="n">Pad1</span><span class="p">)]</span> <span class="n">on</span> <span class="n">F</span><span class="o">.</span><span class="n">Cu</span><span class="p">,</span> <span class="n">length</span><span class="p">:</span> <span class="mf">1.591</span> <span class="n">mm</span>
<span class="o">@</span><span class="p">(</span><span class="mf">177.185</span> <span class="n">mm</span><span class="p">,</span> <span class="mf">80.715</span> <span class="n">mm</span><span class="p">):</span> <span class="n">Pad</span> <span class="mi">2</span> <span class="n">of</span> <span class="n">C3</span> <span class="n">on</span> <span class="n">F</span><span class="o">.</span><span class="n">Cu</span> <span class="ow">and</span> <span class="n">others</span>
<span class="o">**</span> <span class="n">Found</span> <span class="mi">1</span> <span class="n">unconnected</span> <span class="n">pads</span> <span class="o">**</span>
<span class="n">ErrType</span><span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="n">Unconnected</span> <span class="n">items</span>
<span class="o">@</span><span class="p">(</span><span class="mf">177.185</span> <span class="n">mm</span><span class="p">,</span> <span class="mf">73.965</span> <span class="n">mm</span><span class="p">):</span> <span class="n">Pad</span> <span class="mi">2</span> <span class="n">of</span> <span class="n">C4</span> <span class="n">on</span> <span class="n">F</span><span class="o">.</span><span class="n">Cu</span> <span class="ow">and</span> <span class="n">others</span>
<span class="o">@</span><span class="p">(</span><span class="mf">177.185</span> <span class="n">mm</span><span class="p">,</span> <span class="mf">80.715</span> <span class="n">mm</span><span class="p">):</span> <span class="n">Pad</span> <span class="mi">2</span> <span class="n">of</span> <span class="n">C3</span> <span class="n">on</span> <span class="n">F</span><span class="o">.</span><span class="n">Cu</span> <span class="ow">and</span> <span class="n">others</span>
</pre></div>
</div>
<p>And you want to ignore them. You can add the following filters:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">filters</span><span class="p">:</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">filter</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;Ignore</span><span class="nv"> </span><span class="s">C3</span><span class="nv"> </span><span class="s">pad</span><span class="nv"> </span><span class="s">2</span><span class="nv"> </span><span class="s">too</span><span class="nv"> </span><span class="s">close</span><span class="nv"> </span><span class="s">to</span><span class="nv"> </span><span class="s">anything&#39;</span>
<span class="w"> </span><span class="nt">error</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;4&#39;</span>
<span class="w"> </span><span class="nt">regex</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;Pad</span><span class="nv"> </span><span class="s">2</span><span class="nv"> </span><span class="s">of</span><span class="nv"> </span><span class="s">C3&#39;</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">filter</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;Ignore</span><span class="nv"> </span><span class="s">unconnected</span><span class="nv"> </span><span class="s">pad</span><span class="nv"> </span><span class="s">2</span><span class="nv"> </span><span class="s">of</span><span class="nv"> </span><span class="s">C4&#39;</span>
<span class="w"> </span><span class="nt">error</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;2&#39;</span>
<span class="w"> </span><span class="nt">regex</span><span class="p">:</span><span class="w"> </span><span class="s">&#39;Pad</span><span class="nv"> </span><span class="s">2</span><span class="nv"> </span><span class="s">of</span><span class="nv"> </span><span class="s">C4&#39;</span>
</pre></div>
</div>
<p>If you need to match text from two different lines in the error message
try using <code class="docutils literal notranslate"><span class="pre">(?s)TEXT(.*)TEXT_IN_OTHER_LINE</span></code>.</p>
<p>If you have two or more different options for a text to match try using
<code class="docutils literal notranslate"><span class="pre">(OPTION1|OPTION2)</span></code>.</p>
<p>A complete Python regular expressions explanation is out of the scope of
this manual. For a complete reference consult the <a class="reference external" href="https://docs.python.org/3/library/re.html">Python
manual</a>.</p>
<p>KiCad 6 uses strings to differentiate errors, use them for the <code class="docutils literal notranslate"><span class="pre">error</span></code>
field. To keep compatibility you can use the <code class="docutils literal notranslate"><span class="pre">number</span></code> or
<code class="docutils literal notranslate"><span class="pre">error_number</span></code> options for KiCad 5.</p>
<p>Note that this will ignore the errors, but they will be reported as
warnings. If you want to suppress these warnings take a look at
<a class="reference internal" href="global.html#filter-kibot-warnings"><span class="std std-ref">Filtering KiBot warnings</span></a></p>
<p><strong>Important note</strong>: this will create a file named <em>kibot_errors.filter</em>
in the output directory.</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="header.html" class="btn btn-neutral float-left" title="The header" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="global.html" class="btn btn-neutral float-right" title="Default global options" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2018-2023, Salvador E. Tropea/INTI/John Beard.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>