rust-lang / rust-lang/rustfmt

let proc-macro's provide a formatting hook for rustfmt

Open
#5,656 2 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-macros C-feature-request P-low
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

I'm building an app based on dioxus that uses the rsx! proc macro extensively. it's basically html with embedded rust closures. the rsx! macro even has an autoformatter [0] used by a vscode plugin. Since we can't run that in ci it would be really nice if we could somehow tell rustfmt how to format the code.

Contributor guide

Open the contributing guide

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.

Research direction

Start by reviewing the Dioxus formatter linked in packages/autofmt and the rustfmt project to understand the requested integration point. Determine whether proc macros can expose a formatting hook and define how CI would invoke it for rsx! code; done means a documented, usable approach that formats this macro consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.