1
1
Fork
You've already forked strictest
0
Runtime Strictness for Luanti Mods
  • Lua 100%
Find a file
2024年02月25日 20:18:28 +01:00
.luacheckrc A strictness mod is born 2022年06月27日 19:38:12 +02:00
init.lua A strictness mod is born 2022年06月27日 19:38:12 +02:00
License.txt A strictness mod is born 2022年06月27日 19:38:12 +02:00
lua.lua math.random(a, b): Assert a <= b 2023年05月21日 18:38:11 +02:00
minetest.lua Fix broken set_sky warning 2024年02月25日 20:18:28 +01:00
mod.conf Get rid of broken name hack 2022年06月30日 22:21:58 +02:00
Readme.md Clarify that only string indexing misses error 2023年01月14日 18:34:56 +01:00
settingtypes.txt A strictness mod is born 2022年06月27日 19:38:12 +02:00

Strictest

Runtime Strictness for Minetest Mods

Strictest consists of two components:

  • Lua strictness:
    • Disallows string indexing misses: ("...").something will throw an error if there is no string.something to prevent accidental use of strings where tables are expected
    • Disables string - number coercion where possible
  • Minetest strictness: Disallows usage of deprecated APIs & using entity-only or player-only methods on the wrong type of object.

Particularly useful when writing new mods that don't target older Minetest versions.

Configuration

strictest.action can be set to either error or log:

  • error: Immediately throw an error on strictness violations.
  • log: Merely log the error (including a stacktrace).

Potentially partially redundant with the deprecated_lua_api_handling setting.

Usage

Install & enable strictest, then make sure to optionally depend on it in mod.conf.

Note that runtime strictness always comes at a cost. Running strictest on production servers under heavy load is thus not advisable.


Links: GitHub, ContentDB, Minetest Forums

License: Written by Lars Müller and licensed under the MIT license.