Idea: settings hierarchy / categorization
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
Something to consider for 2.0
Right now settings are all over the place in terms of how they are named (e.g. wrap_comments, comment_width, format_code_in_comments, doc_comment_code_block_width) because they inhabit a single namespace. This makes finding formatting options related to various topics require a lexical search through a long document of semi-related items rather than a categorical search through a shorter list.
It might be useful to categorize the settings into groups.
E.g.:
rustfmt.edition
rustfmt.color
comments.wrap
comments.width
comments.doc_comment.format_code
comments.doc_comment.code_block_width
imports.granularity
imports.group
The toml files would have a similar structure to Cargo.toml files, with sections for each table:
[comments]
wrap = true
width = 100
[comments.doc_comments]
# ...
This would make documentation easier to navigate, and make it possible to providing tooling that modifies the config while showing docs and the allowable settings in a GUI (e.g. similar to how vscode displays rust-analyzer settings).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by locating rustfmt's settings definitions, configuration parsing, and documentation, then determine the scope of introducing categorized settings and the compatibility implications; done would require an agreed hierarchy and documented behavior.
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