From f0d5b0423de0eb72cda0b5624ac28d72bf65cffd Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 24 Sep 2024 10:04:03 +0200 Subject: Repository setup: Warn about unknown keys Warn if a repository definition contains unknown keys (that are therefore ignored), as this often indicates a typo in the repository specification. However, for some common naming of extensions (currently: "bootstrap") keep the warning at a level below the default for reporting. --- src/other_tools/just_mr/setup_utils.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/other_tools/just_mr/setup_utils.hpp') diff --git a/src/other_tools/just_mr/setup_utils.hpp b/src/other_tools/just_mr/setup_utils.hpp index 66691441..e29df4a6 100644 --- a/src/other_tools/just_mr/setup_utils.hpp +++ b/src/other_tools/just_mr/setup_utils.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -35,6 +36,22 @@ std::vector const kAltDirs = {"target_root", "rule_root", "expression_root"}; +auto const kRepositoryExpectedFields = + std::unordered_set{"bindings", + "expression_file_name", + "expression_root", + "repository", + "rule_file_name", + "rule_root", + "target_file_name", + "target_root"}; + +// Substrings in repository field names that indicate commonly-used +// additional keys not used by just-mr but deliberately added by the +// author of the repository configuration. +auto const kRepositoryPossibleFieldTrunks = + std::vector{"bootstrap", "doc", "extra"}; + namespace JustMR { struct SetupRepos { -- cgit v1.2.3