Kampfkarren / selene

A blazing-fast modern Lua linter written in Rust
https://kampfkarren.github.io/selene/
Mozilla Public License 2.0
562 stars 76 forks source link

Adding/improving Lua standards #577

Open nvs opened 6 months ago

nvs commented 6 months ago

The standards provided by selene have some deprecated features (e.g. unpack in Lua 5.3) and other inconsistencies present. It might be best to adhere to Lua's default compilation flags, as most users will encounter versions of Lua using those. For reference:

Version Default Flags
Lua 5.1 See luaconf.h
Lua 5.2 LUA_COMPAT_ALL
Lua 5.3 LUA_COMPAT_5_2
Lua 5.4 LUA_COMPAT_5_3

One would need to consult 'luaconf.h' for various details. However, a good example is unpack, while considering the default flags.

Luacheck provides the following standards, to cover various use cases.

Would it make sense for selene to do something similar? Probably just the standards with the default configurations are enough. I also noticed #154, which is related to adding LuaJIT standard.

Kampfkarren commented 5 months ago

Any inconsistencies you see are a result of me being firmly in the world of Roblox, which uses a derivative of 5.1 :)

Any contribution like this would be appreciated.