summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/setup_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/just_mr/setup_utils.cpp')
-rw-r--r--src/other_tools/just_mr/setup_utils.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/other_tools/just_mr/setup_utils.cpp b/src/other_tools/just_mr/setup_utils.cpp
index 4e5e5ad3..4aa710c5 100644
--- a/src/other_tools/just_mr/setup_utils.cpp
+++ b/src/other_tools/just_mr/setup_utils.cpp
@@ -14,6 +14,7 @@
#include "src/other_tools/just_mr/setup_utils.hpp"
+#include <algorithm>
#include <fstream>
#include <unordered_set>
#include <variant>
@@ -26,6 +27,31 @@
#include "src/buildtool/logging/logger.hpp"
#include "src/other_tools/just_mr/exit_codes.hpp"
+namespace {
+
+void WarnUnknownKeys(std::string const& name, ExpressionPtr const& repo_def) {
+ if (not repo_def->IsMap()) {
+ return;
+ }
+ for (auto const& [key, value] : repo_def->Map()) {
+ if (not kRepositoryExpectedFields.contains(key)) {
+ Logger::Log(std::any_of(kRepositoryPossibleFieldTrunks.begin(),
+ kRepositoryPossibleFieldTrunks.end(),
+ [k = key](auto const& trunk) {
+ return k.find(trunk) !=
+ std::string::npos;
+ })
+ ? LogLevel::Debug
+ : LogLevel::Warning,
+ "Ignoring unknown field {} in repository {}",
+ key,
+ name);
+ }
+ }
+}
+
+} // namespace
+
namespace JustMR::Utils {
void ReachableRepositories(
@@ -46,6 +72,7 @@ void ReachableRepositories(
if (not repos_repo_name.IsNotNull()) {
return;
}
+ WarnUnknownKeys(repo_name, repos_repo_name);
auto bindings =
repos_repo_name->Get("bindings", Expression::none_t{});
if (bindings.IsNotNull() and bindings->IsMap()) {