Add script for Luacheck

This commit is contained in:
Jean-Patrick Guerrero
2021-11-30 18:39:35 +01:00
parent 0b4250b54b
commit ab690398b7
5 changed files with 133 additions and 4 deletions

View File

@ -1,6 +1,5 @@
local ItemStack = ItemStack
local loadstring = loadstring
local ESC = core.formspec_escape
local translate = core.get_translated_string
local vec_new, vec_add, vec_mul = vector.new, vector.add, vector.multiply
local sort, concat, insert = table.sort, table.concat, table.insert

View File

@ -241,9 +241,9 @@ local function get_isometric_view(fs, pos, X, Y)
local p = area:position(idx)
p = vec_sub(p, pos)
local size = 0.25
local x = 2 + (size / 2 * (p.z - p.x))
local y = 1.15 + (size / 4 * (p.x + p.z - 2 * p.y))
local size = 0.25
if plant then
size -= 0.05

View File

@ -1,7 +1,7 @@
--[[ All source files have to be preprocessed before loading.
This allows implementing custom operators like bitwise ones. ]]
local fmt = string.format
local fmt, split = string.format, string.split
local var = "[%w%.%[%]\"\'_]"
local operators = {
@ -53,7 +53,7 @@ end
local function _load(path, line, data, t)
if line then
if not t then
t = data:split"\n"
t = split(data, "\n")
end
t[line] = t[line]:gsub("(" .. var .. "+)%s?=%s?(" .. var .. "*)", "%2")
data = table.concat(t, "\n")