Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

luafmt: preserve_statement_semicolon = false removes a required `;` before a `(` statement, output no longer parses

Open Beginner friendly
#1,301 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@sean0407 is already working on this.

Since Oct 17, 2026.

  • #1307 by @sean0407 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
lua, rust
Domain
tooling

Research direction

Start with append_trailing_statement_semicolon in formatter/render/comments.rs, which returns early when preserve_statement_semicolon is off. Reproduce with the two-line input in the issue using a config file that sets preserve_statement_semicolon = false. Done when the ; before a statement starting with ( survives, and it is still removed in other cases.

Written by the indexing model from the issue text.

Description

With preserve_statement_semicolon = false (the default in --dump-default-config), luafmt removes a ; that Lua needs: one that separates a statement from a following statement starting with (. The output no longer parses.

printf '[output]\npreserve_statement_semicolon = false\n' > cfg.toml
printf 'local req = f()\n;(req).style = 1\n' | luafmt --config cfg.toml

Actual:

local req = f()
(req).style = 1

which Lua reads as f()(req).style = 1: luajit reports unexpected symbol near '='. Expected: the ; is kept (e.g. local req = f();), as it is when no config file is given.

The removal is unconditional (append_trailing_statement_semicolon in formatter/render/comments.rs returns early when the option is off). A ; should be dropped only when the next statement does not start with (.

luafmt 0.25.1.

Dominant language
Rust
Stars
517
Forks
101
Avg merge
3d 19h
Merged PRs (30d)
18

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EmmyLuaLs/emmylua-analyzer-rust

All issues in EmmyLuaLs/emmylua-analyzer-rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.