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

luafmt rewrites spacing in doc type expressions (`fns (fun…)[]` → `fns(fun…)[]`, `{…}[]` → `{…} []`, `-nil` → `- nil`)

Open
#1,303 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

The bug is in luafmt's handling of EmmyLua doc comments, so start by finding where the formatter treats ---@param, ---@return and ---@cast lines and their type expressions. Reproduce with the printf command in the issue and check each of the four spacing changes separately. Done means the three example inputs and the ---@class A : B and ---@type table -- why lines come out unchanged, with a test added for each.

Written by the indexing model from the issue text.

Description

luafmt rewrites spacing inside EmmyLua doc type expressions. emmylua_check reads the results the same way (verified), but they are harder to read and diverge from how these types are written everywhere else:

printf -- '---@param fns (fun(): integer)[] the racers\n---@return { x: string }[] r\n---@cast t -nil\n' | luafmt

Actual:

---@param fns(fun(): integer)[] the racers
---@return { x: string } [] r
---@cast t - nil

Expected: unchanged. In particular:

  • the space between a parameter name and a parenthesized type is removed (fns (fun…) → fns(fun…));
  • an array suffix on a table literal type is split off ({ … }[] → { … } []);
  • ---@cast x -nil becomes - nil.

Also observed: ---@class A : B → ---@class A: B, and -- inside a description after the type (---@type table -- why) → --why.

luafmt 0.25.1, default config.

Dominant language
Rust
Stars
523
Forks
104
Avg merge
2d 5h
Merged PRs (30d)
21

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.