rust-lang / rust-lang/rust-playground

Allow upload of rustfmt.toml

Open
#862 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.4k
Forks
268
Avg merge
3h 2m
Merged PRs (30d)
6

Description

Sometimes we have to style the code accordingly with other practices besides the default rustfmt.toml.

If we could upload a config file rustfmt.toml and then format the code based on it, that would be very useful.

One such example would be:

# rustfmt style by drbeco 2022-10-31
#

# unstable available in nightly channel
reorder_impl_items = true
combine_control_expr = false
brace_style = "AlwaysNextLine"
control_brace_style = "AlwaysNextLine"
where_single_line = true
wrap_comments = true
normalize_comments = true
normalize_doc_attributes = true
format_code_in_doc_comments = true

# stable available in all toolchains
fn_args_layout = "Compressed"
match_block_trailing_comma = true
newline_style = "Unix"
single_line_if_else_max_width = 0

Thanks for considering this option.

Contributor guide

No contributing guide indexed for this repository

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 tracing where the Rust Playground accepts uploaded files and invokes rustfmt, then determine how a user-supplied rustfmt.toml can be passed to that formatting step. Done means an uploaded rustfmt.toml is accepted and the resulting code follows its settings, with coverage for the configured formatting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.