TheTermos / mobkit

Entity API for Minetest
MIT License
26 stars 12 forks source link

WIP: Add Luacheck support #17

Closed rubenwardy closed 4 years ago

rubenwardy commented 4 years ago

See https://rubenwardy.com/minetest_modding_book/en/quality/luacheck.html

Btw: you can use VSCod(e/ium), and the Minetest Tools and VSCode-Lua extensions to show minetest Lua linting.

Work in progress. Below are the remaining problems to be fixed. They are mostly due to shadowing, perhaps I should disable that warning

Checking init.lua                                 31 warnings

    init.lua:21:7: unused variable pow
    init.lua:498:36: shadowing upvalue argument self on line 494
    init.lua:498:42: shadowing upvalue pos on line 495
    init.lua:961:22: shadowing upvalue argument self on line 960
    init.lua:972:22: shadowing upvalue argument self on line 969
    init.lua:986:22: shadowing upvalue argument self on line 983
    init.lua:1020:22: shadowing upvalue argument self on line 1017
    init.lua:1047:22: shadowing upvalue argument self on line 1045
    init.lua:1065:22: shadowing upvalue argument self on line 1063
    init.lua:1084:22: shadowing upvalue argument self on line 1081
    init.lua:1129:22: shadowing upvalue argument self on line 1126
    init.lua:1160:22: shadowing upvalue argument self on line 1159
    init.lua:1172:24: shadowing upvalue argument self on line 1171
    init.lua:1203:24: shadowing upvalue argument self on line 1202
    init.lua:1219:24: shadowing upvalue argument self on line 1218
    init.lua:1235:24: shadowing upvalue argument self on line 1232
    init.lua:1265:24: shadowing upvalue argument self on line 1264
    init.lua:1286:24: shadowing upvalue argument self on line 1283
    init.lua:1319:24: shadowing upvalue argument self on line 1316
    init.lua:1322:26: unused argument self
    init.lua:1322:26: shadowing upvalue argument self on line 1319
    init.lua:1332:24: shadowing upvalue argument self on line 1331
    init.lua:1358:24: shadowing upvalue argument self on line 1355
    init.lua:1383:24: shadowing upvalue argument self on line 1381
    init.lua:1457:10: shadowing definition of variable ok on line 1448
    init.lua:1457:13: shadowing definition of variable h on line 1448
    init.lua:1488:24: shadowing upvalue argument self on line 1483
    init.lua:1526:24: shadowing upvalue argument self on line 1525
    init.lua:1540:24: shadowing upvalue argument self on line 1535
    init.lua:1566:9: shadowing upvalue tyaw on line 1536
    init.lua:1568:9: variable yaw was previously defined on line 1548
TheTermos commented 4 years ago

So what happened? It was WIP so I didn't pay much attention.

Now that 5.3 is out I'm going to resume work on this, and probably try out luacheck anyway.