From f8bf91fd7aae72326b18eb093142eda75d9da36d Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 9 Apr 2025 08:48:35 +0200 Subject: [PATCH] fix: better error message --- .../fr/LC_MESSAGES/rougail_user_data_yaml.po | 8 ++-- locale/rougail_user_data_yaml.pot | 4 +- src/rougail/user_data_yaml/__init__.py | 2 +- .../fr/LC_MESSAGES/rougail_user_data_yaml.mo | Bin 940 -> 952 bytes .../file/all_exclude.yml | 5 ++ .../rougail/00-base.yml | 10 ++++ .../file/all_exclude.yml | 5 ++ .../rougail/00-base.yml | 12 +++++ tests/results/00_6secret/file/all.yml | 4 +- tests/results/00_6secret/file/all_exclude.yml | 4 +- tests/results/00_6secret/file/mandatories.yml | 2 +- tests/results/00_6secret/makedict/all.json | 4 +- .../00_6secret/makedict/mandatories.json | 2 +- .../04_1auto_save_and_hidden/errors/all.json | 2 +- .../errors/mandatories.json | 2 +- .../errors/mandatories.json | 2 +- .../errors/all.json | 2 +- .../errors/all.json | 2 +- .../errors/all.json | 2 +- .../errors/mandatories.json | 2 +- .../errors/mandatories.json | 2 +- .../errors/all.json | 2 +- .../errors/all.json | 2 +- .../04_5hidden_calculation2/errors/all.json | 4 +- .../errors/all.json | 2 +- .../errors/mandatories.json | 2 +- .../errors/all.json | 2 +- .../errors/mandatories.json | 2 +- .../16_5exists_redefine/errors/all.json | 2 +- .../16_5redefine_hidden/errors/all.json | 2 +- .../17_5redefine_leadership/errors/all.json | 2 +- .../20_0family_underscore/errors/all.json | 12 ++--- .../errors/all.json | 2 +- .../errors/all.json | 2 +- .../errors/all.json | 4 +- .../errors/mandatories.json | 2 +- .../file/mandatories.yml | 10 +--- .../file/mandatories.yml | 10 +--- .../file/mandatories.yml | 9 +--- .../file/mandatories.yml | 9 +--- .../file/mandatories.yml | 9 +--- .../file/mandatories.yml | 9 +--- .../file/mandatories.yml | 9 +--- .../file/mandatories.yml | 9 +--- .../44_0leadership_hidden/errors/all.json | 2 +- .../errors/all.json | 2 +- .../errors/all.json | 2 +- .../errors/mandatories.json | 2 +- .../file/mandatories.yml | 9 +--- .../errors/all.json | 4 ++ .../errors/mandatories.json | 4 ++ .../file/all.yml | 14 ++++++ .../file/all_exclude.yml | 10 ++++ .../file/mandatories.yml | 10 ++++ .../makedict/all.json | 8 ++++ .../makedict/mandatories.json | 8 ++++ .../results/60_0family_hidden/errors/all.json | 2 +- .../errors/all.json | 2 +- .../errors/mandatories.json | 2 +- .../errors/all.json | 7 +++ .../errors/mandatories.json | 4 ++ .../file/all.yml | 15 ++++++ .../file/all_exclude.yml | 11 +++++ .../file/mandatories.yml | 5 ++ .../makedict/all.json | 7 +++ .../makedict/mandatories.json | 4 ++ .../errors/all.json | 4 +- .../errors/all.json | 4 +- tests/test_load.py | 45 +++++++++++++++++- 69 files changed, 251 insertions(+), 132 deletions(-) create mode 100644 tests/errors/60_0family_dynamic_upper_char/file/all_exclude.yml create mode 100644 tests/errors/60_0family_dynamic_upper_char/rougail/00-base.yml create mode 100644 tests/errors/60_0family_dynamic_upper_char2/file/all_exclude.yml create mode 100644 tests/errors/60_0family_dynamic_upper_char2/rougail/00-base.yml create mode 100644 tests/results/60_0family_dynamic_upper_char/errors/all.json create mode 100644 tests/results/60_0family_dynamic_upper_char/errors/mandatories.json create mode 100644 tests/results/60_0family_dynamic_upper_char/file/all.yml create mode 100644 tests/results/60_0family_dynamic_upper_char/file/all_exclude.yml create mode 100644 tests/results/60_0family_dynamic_upper_char/file/mandatories.yml create mode 100644 tests/results/60_0family_dynamic_upper_char/makedict/all.json create mode 100644 tests/results/60_0family_dynamic_upper_char/makedict/mandatories.json create mode 100644 tests/results/60_5family_dynamic_calc_suffix_disabled2/errors/all.json create mode 100644 tests/results/60_5family_dynamic_calc_suffix_disabled2/errors/mandatories.json create mode 100644 tests/results/60_5family_dynamic_calc_suffix_disabled2/file/all.yml create mode 100644 tests/results/60_5family_dynamic_calc_suffix_disabled2/file/all_exclude.yml create mode 100644 tests/results/60_5family_dynamic_calc_suffix_disabled2/file/mandatories.yml create mode 100644 tests/results/60_5family_dynamic_calc_suffix_disabled2/makedict/all.json create mode 100644 tests/results/60_5family_dynamic_calc_suffix_disabled2/makedict/mandatories.json diff --git a/locale/fr/LC_MESSAGES/rougail_user_data_yaml.po b/locale/fr/LC_MESSAGES/rougail_user_data_yaml.po index d780f6e..40b51fa 100644 --- a/locale/fr/LC_MESSAGES/rougail_user_data_yaml.po +++ b/locale/fr/LC_MESSAGES/rougail_user_data_yaml.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2025-02-10 09:21+0100\n" -"PO-Revision-Date: 2025-02-10 09:22+0100\n" +"POT-Creation-Date: 2025-04-09 08:34+0200\n" +"PO-Revision-Date: 2025-04-09 08:35+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -27,8 +27,8 @@ msgstr "" "\"{1}\"" #: src/rougail/user_data_yaml/__init__.py:85 -msgid "yaml ({0})" -msgstr "fichier yaml ({0})" +msgid "the YAML file \"{0}\"" +msgstr "le fichier YAML \"{0}\"" #: src/rougail/user_data_yaml/__init__.py:116 msgid "\"{0}\" in {1} has an unknown value" diff --git a/locale/rougail_user_data_yaml.pot b/locale/rougail_user_data_yaml.pot index 1ec1b3d..10d9f0a 100644 --- a/locale/rougail_user_data_yaml.pot +++ b/locale/rougail_user_data_yaml.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-02-10 09:22+0100\n" +"POT-Creation-Date: 2025-04-09 08:48+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,7 +24,7 @@ msgid "cannot load \"{0}\", the root value is not a dict but \"{1}\"" msgstr "" #: src/rougail/user_data_yaml/__init__.py:85 -msgid "yaml ({0})" +msgid "the YAML file \"{0}\"" msgstr "" #: src/rougail/user_data_yaml/__init__.py:116 diff --git a/src/rougail/user_data_yaml/__init__.py b/src/rougail/user_data_yaml/__init__.py index 3f8a170..9082da0 100644 --- a/src/rougail/user_data_yaml/__init__.py +++ b/src/rougail/user_data_yaml/__init__.py @@ -82,7 +82,7 @@ class RougailUserDataYaml: allow_secrets_variables = True user_datas.append( { - "source": _("yaml ({0})").format(filename), + "source": _('the YAML file "{0}"').format(filename), "errors": self.errors, "warnings": self.warnings, "values": values, diff --git a/src/rougail/user_data_yaml/locale/fr/LC_MESSAGES/rougail_user_data_yaml.mo b/src/rougail/user_data_yaml/locale/fr/LC_MESSAGES/rougail_user_data_yaml.mo index 9bb977b1c09364c7420ae7b2d0f6ef0f07bafb22..4fdc703622d932e41d643210f46446dbf35b50dc 100644 GIT binary patch delta 173 zcmZ3(zJq;&kFPKT14AJr1A`)vZUxeRf%I}9tqP=$T7sE@ z!52uY18GqpT?(XifOPl7nbN%MKn9S{zy`z&6Ax|>F3Ct$h;;PzQAo?oNmWp)HmFsa sT+JB3YocplsbFAXWo)W#V6^!L;}k|wpnO_pazaUHWB08{26kN^Mx delta 161 zcmdnNzJ`5*k1rPk14AJr1A`)vt^v}2f%H5etqP>)FflNw1L;FRS_MeI0@8dynxC10 z!52u&0cjy1odcwGfOP%DnbN#KngPgXU;|?Ii3c}uRVL=n0)M`#{VGQ6k(ls