tigris-mt / elevator

An entity-based elevator allowing fast realtime travel in Minetest.
https://forum.minetest.net/viewtopic.php?f=9&t=17079
Other
4 stars 14 forks source link

Fix linter warnings #12

Closed S-S-X closed 3 years ago

S-S-X commented 4 years ago

Why?

Luacheck linter was added at https://github.com/shacknetisp/elevator/commit/13f7c692cbddb53618e904170c6ac1d6762cfa4f and now it is hunting for problems, let it report problems for too long and everyone loses interest in that small :x: mark.

I believe that most of current warnings are pretty straightforward to fix so would be very nice to have clean code without warnings. Few benefits that come into mind without thinking about it for too long:

DoD: fix following warnings

Checking components.lua                           1 warning

    components.lua:151:11: shadowing definition of variable box on line 73

Checking crafts.lua                               OK
Checking formspecs.lua                            OK
Checking helpers.lua                              1 warning

    helpers.lua:16:15: unused variable front_below

Checking hooks.lua                                OK
Checking init.lua                                 7 warnings

    init.lua:103:15: shadowing definition of variable node on line 92
    init.lua:108:19: shadowing definition of variable node on line 103
    init.lua:140:11: unused variable need_saving
    init.lua:150:19: shadowing definition of variable node on line 145
    init.lua:161:39: shadowing upvalue argument add on line 139
    init.lua:183:36: shadowing upvalue argument pos on line 180
    init.lua:307:46: empty if branch

Checking storage.lua                              OK

Total: 9 warnings / 0 errors in 7 files