diff --git a/locale/fr/LC_MESSAGES/rougail_output_doc.po b/locale/fr/LC_MESSAGES/rougail_output_doc.po index d542437..7f8ae56 100644 --- a/locale/fr/LC_MESSAGES/rougail_output_doc.po +++ b/locale/fr/LC_MESSAGES/rougail_output_doc.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2025-03-30 19:45+0200\n" -"PO-Revision-Date: 2025-03-30 19:46+0200\n" +"POT-Creation-Date: 2025-03-31 09:14+0200\n" +"PO-Revision-Date: 2025-03-31 09:15+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -255,8 +255,8 @@ msgid "maximum length for the secret is {0} characters" msgstr "longueur maximal pour le secret est de {0} caractΓ¨res" #: src/rougail/output_doc/utils.py:88 -msgid "forbidden characters are {0}" -msgstr "caractΓ¨res interdits sont {0}" +msgid "forbidden characters: {0}" +msgstr "caractΓ¨res interdits: {0}" #: src/rougail/output_doc/utils.py:93 msgid "this filename could be a relative path" diff --git a/locale/rougail_output_doc.pot b/locale/rougail_output_doc.pot index 8924f69..edb34e1 100644 --- a/locale/rougail_output_doc.pot +++ b/locale/rougail_output_doc.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-03-30 19:46+0200\n" +"POT-Creation-Date: 2025-03-31 09:15+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -254,7 +254,7 @@ msgid "maximum length for the secret is {0} characters" msgstr "" #: src/rougail/output_doc/utils.py:88 -msgid "forbidden characters are {0}" +msgid "forbidden characters: {0}" msgstr "" #: src/rougail/output_doc/utils.py:93 diff --git a/src/rougail/output_doc/doc.py b/src/rougail/output_doc/doc.py index 7c457b2..a6f0f80 100644 --- a/src/rougail/output_doc/doc.py +++ b/src/rougail/output_doc/doc.py @@ -438,7 +438,9 @@ class RougailOutputDoc(Examples): if value is None: value = option.impl_get_extra(param) if value is not None and value is not False: - if isinstance(value, (list, set)): + if isinstance(value, set): + value = list(value) + if isinstance(value, list): value = display_list(value, add_quote=True) informations.setdefault("validators", []).append(msg.format(value)) # get validation information from annotator diff --git a/src/rougail/output_doc/locale/fr/LC_MESSAGES/rougail_output_doc.mo b/src/rougail/output_doc/locale/fr/LC_MESSAGES/rougail_output_doc.mo index 1282998..4a8f2a6 100644 Binary files a/src/rougail/output_doc/locale/fr/LC_MESSAGES/rougail_output_doc.mo and b/src/rougail/output_doc/locale/fr/LC_MESSAGES/rougail_output_doc.mo differ diff --git a/src/rougail/output_doc/utils.py b/src/rougail/output_doc/utils.py index 37b6f53..9683df6 100644 --- a/src/rougail/output_doc/utils.py +++ b/src/rougail/output_doc/utils.py @@ -85,7 +85,7 @@ DocTypes = { "params": { "min_len": _("minimum length for the secret is {0} characters"), "max_len": _("maximum length for the secret is {0} characters"), - "forbidden_char": _("forbidden characters are {0}"), + "forbidden_char": _("forbidden characters: {0}"), }, }, "unix_filename": { diff --git a/tests/results/test/00_6secret_param.adoc b/tests/results/test/00_6secret_param.adoc index 089e337..c6683bd 100644 --- a/tests/results/test/00_6secret_param.adoc +++ b/tests/results/test/00_6secret_param.adoc @@ -15,7 +15,18 @@ The second variable. + **Validators**: * maximum length for the secret is 10 characters -* forbidden characters are "$" and "^" +* 'forbidden characters: "$" and "^"' + +**Default**: value +| + +**secret3** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[secret]` `standard` `mandatory` | +The third variable. + +**Validators**: + +* maximum length for the secret is 10 characters +* 'forbidden characters: "$"' **Default**: value |==== diff --git a/tests/results/test/00_6secret_param.json b/tests/results/test/00_6secret_param.json index 03147ca..8a56b9c 100644 --- a/tests/results/test/00_6secret_param.json +++ b/tests/results/test/00_6secret_param.json @@ -47,7 +47,7 @@ ], "validators": [ "maximum length for the secret is 10 characters", - "forbidden characters are \"$\" and \"^\"" + "forbidden characters: \"$\" and \"^\"" ], "paths": [ "secret2" @@ -58,5 +58,36 @@ "descriptions": [ "The second variable." ] + }, + "secret3": { + "type": "variable", + "default": "value", + "properties": [ + { + "type": "type", + "name": "secret" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + } + ], + "validators": [ + "maximum length for the secret is 10 characters", + "forbidden characters: \"$\"" + ], + "paths": [ + "secret3" + ], + "names": [ + "secret3" + ], + "descriptions": [ + "The third variable." + ] } } \ No newline at end of file diff --git a/tests/results/test/00_6secret_param.md b/tests/results/test/00_6secret_param.md index 73881ca..f022c21 100644 --- a/tests/results/test/00_6secret_param.md +++ b/tests/results/test/00_6secret_param.md @@ -1,5 +1,6 @@ | Variable | Description | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **secret1**<br/>[`secret`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The first variable.<br/>**Validator**: minimum length for the secret is 10 characters | -| **secret2**<br/>[`secret`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The second variable.<br/>**Validators**: <br/>- maximum length for the secret is 10 characters<br/>- forbidden characters are "$" and "^"<br/>**Default**: value | +| **secret2**<br/>[`secret`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The second variable.<br/>**Validators**: <br/>- maximum length for the secret is 10 characters<br/>- forbidden characters: "$" and "^"<br/>**Default**: value | +| **secret3**<br/>[`secret`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The third variable.<br/>**Validators**: <br/>- maximum length for the secret is 10 characters<br/>- forbidden characters: "$"<br/>**Default**: value | diff --git a/tests/results/test/00_6secret_param.sh b/tests/results/test/00_6secret_param.sh index 61c6f7e..bcf6dbf 100644 --- a/tests/results/test/00_6secret_param.sh +++ b/tests/results/test/00_6secret_param.sh @@ -9,7 +9,13 @@ β [1;7m secret [0m [1;7m standard [0m [1;7m mandatory [0m β [1mValidators[0m: β β β - maximum length for the secret is β β β 10 characters β -β β - forbidden characters are "$" and β -β β "^" β +β β - forbidden characters: "$" and "^" β +β β [1mDefault[0m: value β +βββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€ +β [1msecret3[0m β The third variable. β +β [1;7m secret [0m [1;7m standard [0m [1;7m mandatory [0m β [1mValidators[0m: β +β β - maximum length for the secret is β +β β 10 characters β +β β - forbidden characters: "$" β β β [1mDefault[0m: value β βββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββ diff --git a/tests/results/test_examples/00_6secret_param.md b/tests/results/test_examples/00_6secret_param.md index 837d6f4..5a3d282 100644 --- a/tests/results/test_examples/00_6secret_param.md +++ b/tests/results/test_examples/00_6secret_param.md @@ -10,4 +10,5 @@ secret1: secrets --- secret1: secrets secret2: value +secret3: value ``` diff --git a/tests/results/test_namespace/00_6secret_param.adoc b/tests/results/test_namespace/00_6secret_param.adoc index bd609c0..b6f7bf7 100644 --- a/tests/results/test_namespace/00_6secret_param.adoc +++ b/tests/results/test_namespace/00_6secret_param.adoc @@ -17,7 +17,18 @@ The second variable. + **Validators**: * maximum length for the secret is 10 characters -* forbidden characters are "$" and "^" +* 'forbidden characters: "$" and "^"' + +**Default**: value +| + +**rougail.secret3** + +`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[secret]` `standard` `mandatory` | +The third variable. + +**Validators**: + +* maximum length for the secret is 10 characters +* 'forbidden characters: "$"' **Default**: value |==== diff --git a/tests/results/test_namespace/00_6secret_param.json b/tests/results/test_namespace/00_6secret_param.json index ae80755..abc6ab1 100644 --- a/tests/results/test_namespace/00_6secret_param.json +++ b/tests/results/test_namespace/00_6secret_param.json @@ -65,7 +65,7 @@ ], "validators": [ "maximum length for the secret is 10 characters", - "forbidden characters are \"$\" and \"^\"" + "forbidden characters: \"$\" and \"^\"" ], "paths": [ "rougail.secret2" @@ -76,6 +76,37 @@ "descriptions": [ "The second variable." ] + }, + "rougail.secret3": { + "type": "variable", + "default": "value", + "properties": [ + { + "type": "type", + "name": "secret" + }, + { + "type": "mode", + "name": "standard" + }, + { + "type": "property", + "name": "mandatory" + } + ], + "validators": [ + "maximum length for the secret is 10 characters", + "forbidden characters: \"$\"" + ], + "paths": [ + "rougail.secret3" + ], + "names": [ + "secret3" + ], + "descriptions": [ + "The third variable." + ] } } } diff --git a/tests/results/test_namespace/00_6secret_param.md b/tests/results/test_namespace/00_6secret_param.md index 177706c..fc32da6 100644 --- a/tests/results/test_namespace/00_6secret_param.md +++ b/tests/results/test_namespace/00_6secret_param.md @@ -3,5 +3,6 @@ | Variable | Description | |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **rougail.secret1**<br/>[`secret`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `basic` `mandatory` | The first variable.<br/>**Validator**: minimum length for the secret is 10 characters | -| **rougail.secret2**<br/>[`secret`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The second variable.<br/>**Validators**: <br/>- maximum length for the secret is 10 characters<br/>- forbidden characters are "$" and "^"<br/>**Default**: value | +| **rougail.secret2**<br/>[`secret`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The second variable.<br/>**Validators**: <br/>- maximum length for the secret is 10 characters<br/>- forbidden characters: "$" and "^"<br/>**Default**: value | +| **rougail.secret3**<br/>[`secret`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `standard` `mandatory` | The third variable.<br/>**Validators**: <br/>- maximum length for the secret is 10 characters<br/>- forbidden characters: "$"<br/>**Default**: value | diff --git a/tests/results/test_namespace/00_6secret_param.sh b/tests/results/test_namespace/00_6secret_param.sh index 452f46f..c48f2c2 100644 --- a/tests/results/test_namespace/00_6secret_param.sh +++ b/tests/results/test_namespace/00_6secret_param.sh @@ -14,7 +14,13 @@ β [1;7m secret [0m [1;7m standard [0m [1;7m mandatory [0m β [1mValidators[0m: β β β - maximum length for the secret is β β β 10 characters β -β β - forbidden characters are "$" and β -β β "^" β +β β - forbidden characters: "$" and "^" β +β β [1mDefault[0m: value β +βββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€ +β [1mrougail.secret3[0m β The third variable. β +β [1;7m secret [0m [1;7m standard [0m [1;7m mandatory [0m β [1mValidators[0m: β +β β - maximum length for the secret is β +β β 10 characters β +β β - forbidden characters: "$" β β β [1mDefault[0m: value β βββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββ diff --git a/tests/results/test_namespace_examples/00_6secret_param.md b/tests/results/test_namespace_examples/00_6secret_param.md index 5230468..ab0e61b 100644 --- a/tests/results/test_namespace_examples/00_6secret_param.md +++ b/tests/results/test_namespace_examples/00_6secret_param.md @@ -12,4 +12,5 @@ rougail: rougail: secret1: secrets secret2: value + secret3: value ```