diff --git a/README.fr.md b/README.fr.md new file mode 100644 index 0000000..3c625b7 --- /dev/null +++ b/README.fr.md @@ -0,0 +1,131 @@ + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: si formatter n'est pas dans "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + +formatter: + description: Reformater les fichiers de structure + help: |- + Le fichier de structure sera formater en respectant un ensemble de règle : ligne vide entre chaque variable, notation condensée dès que possible, ordre des attributs, réindentation (notamment pour les templates Jinja2), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: si formatter n'est pas défini dans "step.output" + + line_width: 120 # Taille maximum des lignes + + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: si formatter n'est pas dans "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + +formatter: + description: Reformater les fichiers de structure + help: |- + Le fichier de structure sera formater en respectant un ensemble de règle : ligne vide entre chaque variable, notation condensée dès que possible, ordre des attributs, réindentation (notamment pour les templates Jinja2), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: si formatter n'est pas défini dans "step.output" + + line_width: 120 # Taille maximum des lignes + + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: si formatter n'est pas dans "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: trus si formatter n'est pas dans "step.output" + +formatter: + description: Reformater les fichiers de structure + help: |- + Le fichier de structure sera formater en respectant un ensemble de règle : ligne vide entre chaque variable, notation condensée dès que possible, ordre des attributs, réindentation (notamment pour les templates Jinja2), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: si formatter n'est pas défini dans "step.output" + + line_width: 120 # Taille maximum des lignes + +--- +gitea: none +include_toc: true +--- +[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) + +## Reformater les fichiers de structure + +> [!NOTE] +> +> Le fichier de structure sera formater en respectant un ensemble de règle : ligne vide entre chaque variable, notation condensée dès que possible, ordre des attributs, réindentation (notamment pour les templates Jinja2), ...\ +> **Chemin** : formatter\ +> *`désactivé`*\ +> **Désactivé** : si formatter n'est pas défini dans "[Sélection pour sortie](#step.output)" + +| Variable | Description | Valeur par défaut | Type | +|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|---------------------|---------------------------------------------------------------------------------------------------| +| **formatter.line_width**
**Ligne de commande** :
--formatter.line_width
**Variable d'environnement** : FORMATTER.LINE_WIDTH | Taille maximum des lignes. | 120 | [`integer`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | + + diff --git a/README.md b/README.md index 136af25..ec49a63 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,131 @@ -# rougail-output-formatter + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: true if formatter is not in "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: if formatter is not in "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: true if formatter is not in "step.output" + +formatter: + description: Reformat the structure files + help: |- + The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: if formatter is not set in "step.output" + + line_width: 120 # Maximum line size + + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: true if formatter is not in "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: if formatter is not in "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: true if formatter is not in "step.output" + +formatter: + description: Reformat the structure files + help: |- + The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: if formatter is not set in "step.output" + + line_width: 120 # Maximum line size + + +load_unexist_redefine: + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + description: true if formatter is not in "step.output" + hidden: + jinja: >- + {{ step.output is not propertyerror and step.output == 'formatter' }} + return_type: boolean + description: if formatter is not in "step.output" + +cli: + + load_config: + exists: true + redefine: true + type: boolean + default: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + description: true if formatter is not in "step.output" + +formatter: + description: Reformat the structure files + help: |- + The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ... + disabled: + jinja: >- + {{ step.output is propertyerror or step.output != 'formatter' }} + return_type: boolean + description: if formatter is not set in "step.output" + + line_width: 120 # Maximum line size + +--- +gitea: none +include_toc: true +--- +[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) + +## Reformat the structure files + +> [!NOTE] +> +> The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ...\ +> **Path**: formatter\ +> *`disabled`*\ +> **Disabled**: if formatter is not set in "[Select for output](#step.output)" + +| Variable | Description | Default value | Type | +|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|-----------------|-------------------------------------------------------------------------------------------------| +| **formatter.line_width**
**Command line**:
--formatter.line_width
**Environment variable**: FORMATTER.LINE_WIDTH | Maximum line size. | 120 | [`integer`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | + diff --git a/locale/fr/LC_MESSAGES/rougail_output_formatter.po b/locale/fr/LC_MESSAGES/rougail_output_formatter.po index edc5e50..f38d18e 100644 --- a/locale/fr/LC_MESSAGES/rougail_output_formatter.po +++ b/locale/fr/LC_MESSAGES/rougail_output_formatter.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2025-09-29 11:38+0200\n" -"PO-Revision-Date: 2025-09-29 11:46+0200\n" +"POT-Creation-Date: 2025-12-24 09:47+0100\n" +"PO-Revision-Date: 2025-12-24 09:49+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -14,24 +14,54 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: pygettext.py 1.5\n" -"X-Generator: Poedit 3.7\n" +"X-Generator: Poedit 3.8\n" -#: src/rougail/output_formatter/__init__.py:105 +#: src/rougail/output_formatter/__init__.py:119 msgid "the \"step.output\" is not set to \"{0}\"" msgstr "\"step.output\" n'est pas défini pour \"{0}\"" -#: src/rougail/output_formatter/__init__.py:155 -msgid "only one file is allowed" -msgstr "seulement un fichier est autorisé" +#: src/rougail/output_formatter/__init__.py:167 +msgid "only one filename is allowed, not \"{0}\"" +msgstr "seulement un fichier est autorisé, pas \"{0}\"" -#: src/rougail/output_formatter/__init__.py:158 -msgid "only a file is allowed" -msgstr "seulement un fichier est autorisé" +#: src/rougail/output_formatter/__init__.py:170 +msgid "\"{0}\" is not a valid file, but only a file is allowed" +msgstr "" +"\"{0}\" n'est pas un fichier valide, mais seulement un fichier est autorisé" -#: src/rougail/output_formatter/config.py:59 -msgid "Configuration for rougail-ouput-formatter" -msgstr "Configuration pour rougail-ouput-formatter" +#: src/rougail/output_formatter/config.py:34 +#: src/rougail/output_formatter/config.py:50 +msgid "true if formatter is not in \"step.output\"" +msgstr "trus si formatter n'est pas dans \"step.output\"" -#: src/rougail/output_formatter/config.py:61 -msgid "Line size" -msgstr "Taille des lignes" +#: src/rougail/output_formatter/config.py:39 +msgid "if formatter is not in \"step.output\"" +msgstr "si formatter n'est pas dans \"step.output\"" + +#: src/rougail/output_formatter/config.py:53 +msgid "Reformat the structure files" +msgstr "Reformater les fichiers de structure" + +#: src/rougail/output_formatter/config.py:55 +msgid "" +"The structure file will be formatted according to a set of rules: empty line " +"between each variable, condensed notation whenever possible, attribute " +"order, re-indentation (especially for Jinja2 templates), ..." +msgstr "" +"Le fichier de structure sera formater en respectant un ensemble de règle : " +"ligne vide entre chaque variable, notation condensée dès que possible, ordre " +"des attributs, réindentation (notamment pour les templates Jinja2), ..." + +#: src/rougail/output_formatter/config.py:60 +msgid "if formatter is not set in \"step.output\"" +msgstr "si formatter n'est pas défini dans \"step.output\"" + +#: src/rougail/output_formatter/config.py:62 +msgid "Maximum line size" +msgstr "Taille maximum des lignes" + +#~ msgid "only a file is allowed" +#~ msgstr "seulement un fichier est autorisé" + +#~ msgid "Configuration for rougail-ouput-formatter" +#~ msgstr "Configuration pour rougail-ouput-formatter" diff --git a/locale/rougail_output_formatter.pot b/locale/rougail_output_formatter.pot index c4f6f76..11360ed 100644 --- a/locale/rougail_output_formatter.pot +++ b/locale/rougail_output_formatter.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-09-29 11:47+0200\n" +"POT-Creation-Date: 2025-12-24 09:49+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,23 +15,40 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" -#: src/rougail/output_formatter/__init__.py:105 +#: src/rougail/output_formatter/__init__.py:119 msgid "the \"step.output\" is not set to \"{0}\"" msgstr "" -#: src/rougail/output_formatter/__init__.py:155 -msgid "only one file is allowed" +#: src/rougail/output_formatter/__init__.py:167 +msgid "only one filename is allowed, not \"{0}\"" msgstr "" -#: src/rougail/output_formatter/__init__.py:158 -msgid "only a file is allowed" +#: src/rougail/output_formatter/__init__.py:170 +msgid "\"{0}\" is not a valid file, but only a file is allowed" msgstr "" -#: src/rougail/output_formatter/config.py:59 -msgid "Configuration for rougail-ouput-formatter" +#: src/rougail/output_formatter/config.py:34 +#: src/rougail/output_formatter/config.py:50 +msgid "true if formatter is not in \"step.output\"" msgstr "" -#: src/rougail/output_formatter/config.py:61 -msgid "Line size" +#: src/rougail/output_formatter/config.py:39 +msgid "if formatter is not in \"step.output\"" +msgstr "" + +#: src/rougail/output_formatter/config.py:53 +msgid "Reformat the structure files" +msgstr "" + +#: src/rougail/output_formatter/config.py:55 +msgid "The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ..." +msgstr "" + +#: src/rougail/output_formatter/config.py:60 +msgid "if formatter is not set in \"step.output\"" +msgstr "" + +#: src/rougail/output_formatter/config.py:62 +msgid "Maximum line size" msgstr "" diff --git a/src/rougail/output_formatter/config.py b/src/rougail/output_formatter/config.py index bdeb356..c829f33 100644 --- a/src/rougail/output_formatter/config.py +++ b/src/rougail/output_formatter/config.py @@ -30,16 +30,13 @@ load_unexist_redefine: type: boolean default: jinja: >- - {{% if step.output is not propertyerror and step.output == 'formatter' %}} - true - {{% else %}} - false - {{% endif %}} + {{{{ step.output is not propertyerror and step.output == 'formatter' }}}} + description: {_('true if formatter is not in "step.output"')} hidden: jinja: >- - {{% if step.output is not propertyerror and step.output == 'formatter' %}} - load_unexist_redefine is always true with 'formatter' output - {{% endif %}} + {{{{ step.output is not propertyerror and step.output == 'formatter' }}}} + return_type: boolean + description: {_('if formatter is not in "step.output"')} cli: @@ -49,17 +46,22 @@ cli: type: boolean default: jinja: >- - {{% if step.output is not propertyerror and step.output == 'formatter' %}} - false - {{% else %}} - true - {{% endif %}} + {{{{ step.output is propertyerror or step.output != 'formatter' }}}} + description: {_('true if formatter is not in "step.output"')} formatter: - description: {_('Configuration for rougail-ouput-formatter')} + description: {_('Reformat the structure files')} + help: |- + {_('The structure file will be formatted according to a set of rules: empty line between each variable, condensed notation whenever possible, attribute order, re-indentation (especially for Jinja2 templates), ...')} + disabled: + jinja: >- + {{{{ step.output is propertyerror or step.output != 'formatter' }}}} + return_type: boolean + description: {_('if formatter is not set in "step.output"')} - line_width: 120 # {_('Line size')} + line_width: 120 # {_('Maximum line size')} """ + print(options) return { "name": "formatter", "process": "output", diff --git a/src/rougail/output_formatter/locale/fr/LC_MESSAGES/rougail_output_formatter.mo b/src/rougail/output_formatter/locale/fr/LC_MESSAGES/rougail_output_formatter.mo index 67ad2f4..dfd94d1 100644 Binary files a/src/rougail/output_formatter/locale/fr/LC_MESSAGES/rougail_output_formatter.mo and b/src/rougail/output_formatter/locale/fr/LC_MESSAGES/rougail_output_formatter.mo differ