From 1cc2c9028d03ddf15840d5138db518ab4fa26d44 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 18 Dec 2013 23:25:35 -0200 Subject: Add check that will be used to ensure no rocks without licenses are uploaded. Closes #202. --- src/luarocks/lint.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/luarocks/lint.lua b/src/luarocks/lint.lua index 62ced64d..e3bf34b5 100644 --- a/src/luarocks/lint.lua +++ b/src/luarocks/lint.lua @@ -37,5 +37,17 @@ function run(...) return nil, "Failed loading rockspec: "..err end - return true + local ok = true + + -- This should have been done in the type checker, + -- but it would break compatibility of other commands. + -- Making 'lint' alone be stricter shouldn't be a problem, + -- because extra-strict checks is what lint-type commands + -- are all about. + if not rs.description.license then + util.printerr("Rockspec has no license field.") + ok = false + end + + return ok, ok or filename.." failed consistency checks." end -- cgit v1.2.3-55-g6feb