calls selene

  • supports luanti globals by default
  • allows calling a globals that are the name of mods dep’d on
  • configured by [linter] in flint.toml

Luanti lints#

flint adds its own lints on top of selene’s. they’re configured the same way, in [linter.lints] and [linter.config].

lintdefaultdescription
luanti_legacy_physics_overridedenyplayer:set_physics_override(speed, jump, gravity) instead of a table, e.g. player:set_physics_override({ speed = 1.5 })
luanti_deprecated_envdenycore.env or minetest.env, on its own or with anything after it. its methods are functions on core, e.g. core.get_node(pos) instead of core.env:get_node(pos)
luanti_minetest_globalwarnthe minetest global instead of core, e.g. core.log("hi") instead of minetest.log("hi")
luanti_deprecated_register_on_auth_failwarncore.register_on_auth_fail, use core.register_on_authplayer and check is_success
luanti_deprecated_setting_get_poswarncore.setting_get_pos(name), use core.settings:get_pos(name)
luanti_legacy_get_value_noisewarncore.get_value_noise(seeddiff, octaves, persistence, spread), pass a noiseparams table
luanti_deprecated_get_perlinwarncore.get_perlin, renamed to core.get_value_noise
luanti_deprecated_get_mapgen_paramswarncore.get_mapgen_params(), use core.get_mapgen_setting(name)
luanti_deprecated_set_mapgen_paramswarncore.set_mapgen_params(params), use core.set_mapgen_setting(name, value, override)
luanti_deprecated_get_node_groupwarncore.get_node_group(name, group), use core.get_item_group(name, group)
luanti_deprecated_get_entity_namewarnobj:get_entity_name(), use obj:get_luaentity().name
luanti_deprecated_get_player_velocitywarnplayer:get_player_velocity(), use player:get_velocity()
luanti_deprecated_add_player_velocitywarnplayer:add_player_velocity(vel), use player:add_velocity(vel)
luanti_deprecated_get_look_pitchwarnplayer:get_look_pitch(), use player:get_look_vertical()
luanti_deprecated_get_look_yawwarnplayer:get_look_yaw(), use player:get_look_horizontal()
luanti_deprecated_set_look_pitchwarnplayer:set_look_pitch(radians), use player:set_look_vertical(radians)
luanti_deprecated_set_look_yawwarnplayer:set_look_yaw(radians), use player:set_look_horizontal(radians)

Filter comments#

change the severity of lints for part of a file with allow, warn or deny:

-- flint: allow(unused_variable)
local function unused() end

local a = 1 -- flint: allow(unused_variable, shadowing)

--# flint: allow(undefined_variable)
  • a comment covers the statement it’s in front of, on the same line as, or inside of. a comment before a function covers the whole function
  • when filters overlap, the innermost one wins
  • --# covers the whole file, and must come before any code
  • selene’s -- selene: allow(...) comments work the same way, and cover Luanti lints too
  • filters for lints that don’t exist and misplaced --# filters are reported as invalid_lint_filter