Code Guidelines

Contributions follow the style of the code around them.

Luwu no longer syncs with upstream Luau. When we want a feature or fix from upstream, we pick it out and port it by hand so Luwu's behavior and optimizations stay intact. Don't reformat code that came from upstream: its original formatting makes it easier to compare against Luau when porting a change.

C++

LuauClass* luaR_newclass(
    lua_State* L,
    TString* name,
    uint32_t numberofinstancemembers,
    uint32_t numberofstaticmembers,
    bool hasmemberdefaults
)

Luwu comment tags

Code and comments that change behavior or document a Luwu design decision get a tag:

Reuse a feature's existing tag, and never use a flag's name as a tag. To sign a comment so tools and other editors leave it alone, write // name <optional@email>: comment with a blank line or code between it and other comments.

Luwu

Luau code in the repository may follow StyLua's conventions, but that isn't required.

Rust and Python

Writing

Comments, docs and commit messages say what something is for in plain sentences. A commit subject is type(scope): message, like fix(analysis): ....