From e68eb30163687f861e772d557c94c3032389896a Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 19 Jul 2024 14:20:14 -0300 Subject: [PATCH] tl: do not complain about unknown keys in tlconfig.lua --- spec/config/errors.lua | 5 ++--- tl | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/spec/config/errors.lua b/spec/config/errors.lua index 45d2ea7ed..25909f4e5 100644 --- a/spec/config/errors.lua +++ b/spec/config/errors.lua @@ -1,13 +1,12 @@ describe("config", function() - it("should report unknown keys in tlconfig.lua", function() + it("should not report unknown keys in tlconfig.lua", function() util.run_mock_project(finally, { dir_structure = { ["tlconfig.lua"] = [[return { foo = "hello" }]], }, cmd = "check", args = { "tlconfig.lua" }, - cmd_output = [[* in key "foo": unknown config key 'foo' -======================================== + cmd_output = [[======================================== Type checked tlconfig.lua 0 errors detected -- you can use: diff --git a/tl b/tl index a7f214784..95a824d2b 100755 --- a/tl +++ b/tl @@ -786,7 +786,7 @@ local function validate_config(config) if k == "preload_modules" then fail(k, "this key is no longer supported. To load a definition globally into the environment, use global_env_def.") elseif not valid_keys[k] then - warning(k, "unknown config key '" .. k .. "'") + -- skip invalid keys, to be used by other tools elseif type(valid_keys[k]) == "table" then if not valid_keys[k][v] then fail(k, "expected one of: %s", table.concat(keys(valid_keys[k][v]), ", "))