Only put spaces around ranges when start and end is specified
Open
Nobody has claimed this yet.
A-whitespace
C-feature-request
P-low
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
The spaces_around_ranges option currently only accepts a bool: All ranges will be either surrounded with spaces or not. I'd prefer to have a setting that lets me express "put spaces only around ranges that have start and end specified", such as a .. b but not foo[start..] or bar[..end].
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
Start by tracing the spaces_around_ranges option through rustfmt's configuration and range-formatting logic. Identify the existing tests for spaced ranges, then add coverage for ranges with both bounds versus open-ended ranges; done means the new setting formats only fully bounded ranges with spaces.
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
- 45/100