diff --git a/README.md b/README.md index 778d58f2..c292801a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ * [The header](#the-header) * [The *preflight* section](#the-preflight-section) * [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) * [Default global options](#default-global-options) * [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. - `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. + This pre-flight modifies the PCB. Even when a back-up is done use it carefully. * Valid keys: - `date_command`: [string=''] Command to get the date to use in the PCB.\ ```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. 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. + This pre-flight modifies the schematics. Even when a back-up is done use it carefully. * Valid keys: - `date_command`: [string=''] Command to get the date to use in the SCH.\ ```git log -1 --format='%as' -- $KIBOT_SCH_NAME```\ @@ -172,6 +175,15 @@ preflight: 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 Sometimes KiCad reports DRC or ERC errors that you can't get rid off. diff --git a/docs/README.in b/docs/README.in index fa51f04e..3e7ebf32 100644 --- a/docs/README.in +++ b/docs/README.in @@ -20,6 +20,7 @@ * [The header](#the-header) * [The *preflight* section](#the-preflight-section) * [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) * [Default global options](#default-global-options) * [Default *output* option](#default-output-option) @@ -116,6 +117,15 @@ preflight: 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 Sometimes KiCad reports DRC or ERC errors that you can't get rid off. diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 6b6e9a0c..8a434134 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -18,6 +18,7 @@ preflight: # [boolean=false] Option for `run_drc`. Ignores the unconnected nets. Useful if you didn't finish the routing. ignore_unconnected: false # [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: date_command: "git log -1 --format='%as' -- $KIBOT_PCB_NAME" replace_tags: @@ -33,6 +34,7 @@ preflight: # The report file name is controlled by the global output pattern (%i=erc %x=txt). run_erc: true # [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: date_command: "git log -1 --format='%as' -- $KIBOT_SCH_NAME" replace_tags: diff --git a/kibot/pre_pcb_replace.py b/kibot/pre_pcb_replace.py index c466e213..9d100a4a 100644 --- a/kibot/pre_pcb_replace.py +++ b/kibot/pre_pcb_replace.py @@ -27,7 +27,8 @@ class PCB_ReplaceOptions(Base_ReplaceOptions): @pre_class 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' def __init__(self, name, value): diff --git a/kibot/pre_sch_replace.py b/kibot/pre_sch_replace.py index 43454fc9..05571fc0 100644 --- a/kibot/pre_sch_replace.py +++ b/kibot/pre_sch_replace.py @@ -31,7 +31,8 @@ class SCH_ReplaceOptions(Base_ReplaceOptions): @pre_class 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' def __init__(self, name, value):