Suggestion: Lua Runtime Strictness #3119

Open
opened 2 weeks ago by sherkhan30452 · 3 comments

Runtime Strictness
https://content.minetest.net/packages/LMD/strictest/

Disallows questionable usage of the Lua API & Lua itself to help catch errors.

Description:
Runtime Strictness for Minetest Mods

Strictest consists of two components:

Lua strictness: Will disallow string indexing and string - number coercion.
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.

Runtime Strictness https://content.minetest.net/packages/LMD/strictest/ Disallows questionable usage of the Lua API & Lua itself to help catch errors. Description: Runtime Strictness for Minetest Mods Strictest consists of two components: Lua strictness: Will disallow string indexing and string - number coercion. 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.
AliasAlreadyTaken added the
1. kind/enhancement
label 2 weeks ago
Collaborator

Will disallow string indexing and string - number coercion.

when are these useful? lua is already rather strict, i can't recall a bug i blamed on such a feature.

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

the server generally runs the latest stable version, why should we care?

> Will disallow string indexing and string - number coercion. when are these useful? lua is already rather strict, i can't recall a bug i blamed on such a feature. > Particularly useful when writing new mods that don't target older Minetest versions. the server generally runs the latest stable version, why should we care?
Collaborator

stuff that does shenanigans shouldn´t end up on the server so that mod wouldn´t be helpful there.
maybe useful in a dev environment but for me it would make more sense to add those things to luacheck or similar in your code editor to get a warning even before you start minetest.

stuff that does shenanigans shouldn´t end up on the server so that mod wouldn´t be helpful there. maybe useful in a dev environment but for me it would make more sense to add those things to luacheck or similar in your code editor to get a warning even before you start minetest.
flux added
1. kind/bug
1. kind/other
1. kind/breaking
and removed
1. kind/enhancement
labels 1 week ago
Collaborator

(again, i need to not respond to things when i'm half asleep, i didn't properly understand this)

this is the sort of thing that out to be run by developers in their local environment, not on a live server.

also, triggering errors for use of deprecated API is already a config option:

however, your-land depends on a lot of mods which haven't seen active development in a long time, and use deprecated API calls. cleaning all that up is something i've had in the back of my head for a while, but there's been more important things to care about.

(again, i need to not respond to things when i'm half asleep, i didn't properly understand this) this is the sort of thing that out to be run by *developers* in their *local* environment, not on a live server. also, triggering errors for use of deprecated API is already a config option: * https://github.com/minetest/minetest/blob/1c10988d6a19b06ac9c64e83675a76dea29cad2e/builtin/settingtypes.txt#L1583-L1587 however, your-land depends on a *lot* of mods which haven't seen active development in a long time, and use deprecated API calls. cleaning all that up is something i've had in the back of my head for a while, but there's been more important things to care about.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#3119
Loading…
There is no content yet.