Skip to content

Commit

Permalink
tl: do not complain about unknown keys in tlconfig.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Jul 19, 2024
1 parent 64a0fc5 commit 6485d89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions spec/config/errors.lua
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tl
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,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]), ", "))
Expand Down

0 comments on commit 6485d89

Please sign in to comment.