Added some warnings about the replacement options.

This commit is contained in:
Salvador E. Tropea 2021-12-03 18:23:21 -03:00
parent 308725e24f
commit c02a4f814d
5 changed files with 28 additions and 2 deletions

View File

@ -20,6 +20,7 @@
* [The header](#the-header) * [The header](#the-header)
* [The *preflight* section](#the-preflight-section) * [The *preflight* section](#the-preflight-section)
* [Supported *preflight* options](#supported-preflight-options) * [Supported *preflight* options](#supported-preflight-options)
* [More about *pcb_replace* and *sch_replace*](#more-about-pcb_replace-and-sch_replace)
* [Filtering DRC and ERC errors](#filtering-drc-and-erc-errors) * [Filtering DRC and ERC errors](#filtering-drc-and-erc-errors)
* [Default global options](#default-global-options) * [Default global options](#default-global-options)
* [Default *output* option](#default-output-option) * [Default *output* option](#default-output-option)
@ -118,6 +119,7 @@ This section is used to specify tasks that will be executed before generating an
- *regexp*: Alias for regex. - *regexp*: Alias for regex.
- `ignore_unconnected`: [boolean=false] Option for `run_drc`. Ignores the unconnected nets. Useful if you didn't finish the routing. - `ignore_unconnected`: [boolean=false] Option for `run_drc`. Ignores the unconnected nets. Useful if you didn't finish the routing.
- `pcb_replace`: [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date. - `pcb_replace`: [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date.
This pre-flight modifies the PCB. Even when a back-up is done use it carefully.
* Valid keys: * Valid keys:
- `date_command`: [string=''] Command to get the date to use in the PCB.\ - `date_command`: [string=''] Command to get the date to use in the PCB.\
```git log -1 --format='%as' -- $KIBOT_PCB_NAME```\ ```git log -1 --format='%as' -- $KIBOT_PCB_NAME```\
@ -139,6 +141,7 @@ This section is used to specify tasks that will be executed before generating an
- `run_erc`: [boolean=false] Runs the ERC (Electrical Rules Check). To ensure the schematic is electrically correct. - `run_erc`: [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). The report file name is controlled by the global output pattern (%i=erc %x=txt).
- `sch_replace`: [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date. - `sch_replace`: [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date.
This pre-flight modifies the schematics. Even when a back-up is done use it carefully.
* Valid keys: * Valid keys:
- `date_command`: [string=''] Command to get the date to use in the SCH.\ - `date_command`: [string=''] Command to get the date to use in the SCH.\
```git log -1 --format='%as' -- $KIBOT_SCH_NAME```\ ```git log -1 --format='%as' -- $KIBOT_SCH_NAME```\
@ -172,6 +175,15 @@ preflight:
ignore_unconnected: false ignore_unconnected: false
``` ```
#### More about *pcb_replace* and *sch_replace*
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.
Don't 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 don't actually commit any changes.
#### Filtering DRC and ERC errors #### Filtering DRC and ERC errors
Sometimes KiCad reports DRC or ERC errors that you can't get rid off. Sometimes KiCad reports DRC or ERC errors that you can't get rid off.

View File

@ -20,6 +20,7 @@
* [The header](#the-header) * [The header](#the-header)
* [The *preflight* section](#the-preflight-section) * [The *preflight* section](#the-preflight-section)
* [Supported *preflight* options](#supported-preflight-options) * [Supported *preflight* options](#supported-preflight-options)
* [More about *pcb_replace* and *sch_replace*](#more-about-pcb_replace-and-sch_replace)
* [Filtering DRC and ERC errors](#filtering-drc-and-erc-errors) * [Filtering DRC and ERC errors](#filtering-drc-and-erc-errors)
* [Default global options](#default-global-options) * [Default global options](#default-global-options)
* [Default *output* option](#default-output-option) * [Default *output* option](#default-output-option)
@ -116,6 +117,15 @@ preflight:
ignore_unconnected: false ignore_unconnected: false
``` ```
#### More about *pcb_replace* and *sch_replace*
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.
Don't 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 don't actually commit any changes.
#### Filtering DRC and ERC errors #### Filtering DRC and ERC errors
Sometimes KiCad reports DRC or ERC errors that you can't get rid off. Sometimes KiCad reports DRC or ERC errors that you can't get rid off.

View File

@ -18,6 +18,7 @@ preflight:
# [boolean=false] Option for `run_drc`. Ignores the unconnected nets. Useful if you didn't finish the routing. # [boolean=false] Option for `run_drc`. Ignores the unconnected nets. Useful if you didn't finish the routing.
ignore_unconnected: false ignore_unconnected: false
# [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date. # [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date.
# This pre-flight modifies the PCB. Even when a back-up is done use it carefully.
pcb_replace: pcb_replace:
date_command: "git log -1 --format='%as' -- $KIBOT_PCB_NAME" date_command: "git log -1 --format='%as' -- $KIBOT_PCB_NAME"
replace_tags: replace_tags:
@ -33,6 +34,7 @@ preflight:
# The report file name is controlled by the global output pattern (%i=erc %x=txt). # The report file name is controlled by the global output pattern (%i=erc %x=txt).
run_erc: true run_erc: true
# [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date. # [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date.
# This pre-flight modifies the schematics. Even when a back-up is done use it carefully.
sch_replace: sch_replace:
date_command: "git log -1 --format='%as' -- $KIBOT_SCH_NAME" date_command: "git log -1 --format='%as' -- $KIBOT_SCH_NAME"
replace_tags: replace_tags:

View File

@ -27,7 +27,8 @@ class PCB_ReplaceOptions(Base_ReplaceOptions):
@pre_class @pre_class
class PCB_Replace(Base_Replace): # noqa: F821 class PCB_Replace(Base_Replace): # noqa: F821
""" [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date """ """ [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date.
This pre-flight modifies the PCB. Even when a back-up is done use it carefully """
_context = 'PCB' _context = 'PCB'
def __init__(self, name, value): def __init__(self, name, value):

View File

@ -31,7 +31,8 @@ class SCH_ReplaceOptions(Base_ReplaceOptions):
@pre_class @pre_class
class SCH_Replace(Base_Replace): # noqa: F821 class SCH_Replace(Base_Replace): # noqa: F821
""" [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date """ """ [dict] Replaces tags in the schematic. I.e. to insert the git hash or last revision date.
This pre-flight modifies the schematics. Even when a back-up is done use it carefully """
_context = 'SCH' _context = 'SCH'
def __init__(self, name, value): def __init__(self, name, value):