Skip to content

Commit

Permalink
chore: Rename Minetest → Luanti per upstream project rebrand
Browse files Browse the repository at this point in the history
  • Loading branch information
appgurueu authored and alerque committed Nov 12, 2024
1 parent 9f67f8f commit a25463e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion luacheck-dev-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ build = {
luacheck = "src/luacheck/init.lua",
["luacheck.builtin_standards"] = "src/luacheck/builtin_standards/init.lua",
["luacheck.builtin_standards.love"] = "src/luacheck/builtin_standards/love.lua",
["luacheck.builtin_standards.minetest"] = "src/luacheck/builtin_standards/minetest.lua",
["luacheck.builtin_standards.luanti"] = "src/luacheck/builtin_standards/luanti.lua",
["luacheck.builtin_standards.playdate"] = "src/luacheck/builtin_standards/playdate.lua",
["luacheck.builtin_standards.ngx"] = "src/luacheck/builtin_standards/ngx.lua",
["luacheck.cache"] = "src/luacheck/cache.lua",
Expand Down
23 changes: 13 additions & 10 deletions spec/cli_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ Checking spec/samples/globals.lua 2 warnings
Checking spec/samples/indirect_globals.lua 3 warnings
Checking spec/samples/inline_options.lua 7 warnings / 2 errors
Checking spec/samples/line_length.lua 8 warnings
Checking spec/samples/minetest.lua 2 warnings
Checking spec/samples/luanti.lua 2 warnings
Checking spec/samples/python_code.lua 1 error
Checking spec/samples/read_globals.lua 5 warnings
Checking spec/samples/read_globals_inline_options.lua 3 warnings
Expand All @@ -1269,7 +1269,7 @@ Checking globals.lua 2 warnings
Checking indirect_globals.lua 3 warnings
Checking inline_options.lua 7 warnings / 2 errors
Checking line_length.lua 8 warnings
Checking minetest.lua 2 warnings
Checking luanti.lua 2 warnings
Checking python_code.lua 1 error
Checking read_globals.lua 5 warnings
Checking read_globals_inline_options.lua 3 warnings
Expand All @@ -1295,7 +1295,7 @@ Checking globals.lua 2 warnings
Checking indirect_globals.lua 3 warnings
Checking inline_options.lua 7 warnings / 2 errors
Checking line_length.lua 8 warnings
Checking minetest.lua 2 warnings
Checking luanti.lua 2 warnings
Checking python_code.lua 1 error
Checking redefined.lua 7 warnings
Checking reversed_fornum.lua 1 warning
Expand Down Expand Up @@ -1355,13 +1355,16 @@ Total: 1 warning / 0 errors in 1 file
end)

describe("responds to builtin std preset", function()
it("minetest", function()
-- make sure minetest sample has something that normally throws a lint error
assert.equal(1, get_exitcode "spec/samples/minetest.lua --no-config")
-- turning on minetest std should pass all lints
assert.equal(0, get_exitcode "spec/samples/minetest.lua --no-config --std minetest")
-- confirm minetest std set isn't just blindly allowing anything
assert.equal(1, get_exitcode "spec/samples/sample.rockspec --no-config --std minetest")
it("luanti", function()
-- make sure luanti sample has something that normally throws a lint error
assert.equal(1, get_exitcode "spec/samples/luanti.lua --no-config")
-- test both the new "luanti" std name and the "minetest" compatibility alias
for _, std_name in ipairs {"luanti", "minetest"} do
-- turning on luanti std should pass all lints
assert.equal(0, get_exitcode("spec/samples/luanti.lua --no-config --std " .. std_name))
-- confirm luanti std set isn't just blindly allowing anything
assert.equal(1, get_exitcode("spec/samples/sample.rockspec --no-config --std " .. std_name))
end
end)
end)

Expand Down
2 changes: 2 additions & 0 deletions spec/samples/luanti.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
local _ = core
local _ = core.get_current_modname()
2 changes: 0 additions & 2 deletions spec/samples/minetest.lua

This file was deleted.

6 changes: 4 additions & 2 deletions src/luacheck/builtin_standards/init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local love = require "luacheck.builtin_standards.love"
local minetest = require "luacheck.builtin_standards.minetest"
local luanti = require "luacheck.builtin_standards.luanti"
local playdate = require "luacheck.builtin_standards.playdate"
local ngx = require "luacheck.builtin_standards.ngx"
local standards = require "luacheck.standards"
Expand Down Expand Up @@ -297,7 +297,9 @@ builtin_standards.busted = {

builtin_standards.love = love

builtin_standards.minetest = minetest
builtin_standards.luanti = luanti
-- Minetest was renamed to Luanti. Keep an alias for compatibility.
builtin_standards.minetest = luanti

builtin_standards.playdate = playdate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-- minetest lua api standard
-- lua-api reference: https://github.com/minetest/minetest/blob/master/doc/lua_api.md
-- Luanti Lua API standard
-- API reference: https://github.com/minetest/minetest/blob/master/doc/lua_api.md
local standards = require "luacheck.standards"

local empty = {}
local read_write = {read_only = false}
local open_table = {read_only = false, other_fields = true}

-- main namespace
local minetest = {
local core = {
fields = {
-- Utilities
get_current_modname = empty,
Expand Down Expand Up @@ -450,7 +450,9 @@ local vector = standards.def_fields("new", "zero", "copy", "from_string", "to_st
return {
read_globals = {
-- main namespace
minetest = minetest,
core = core,
-- compatibility alias
minetest = core,

-- extensions
table = table,
Expand Down
2 changes: 1 addition & 1 deletion src/luacheck/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Links:
" luajit - globals of LuaJIT 2.x;\n" ..
" ngx_lua - globals of Openresty lua-nginx-module 0.10.10, including standard LuaJIT 2.x globals;\n" ..
" love - globals added by LÖVE;\n" ..
" minetest - globals added by minetest;\n" ..
" luanti - globals added by Luanti (formerly Minetest);\n" ..
" playdate - globals added by the Playdate SDK;\n" ..
" busted - globals added by Busted 2.0, by default added for files ending with _spec.lua within spec, " ..
"test, and tests subdirectories;\n" ..
Expand Down

0 comments on commit a25463e

Please sign in to comment.