`just --fmt` should preserve single-value attribute syntax
- Dominant language
- Rust
- Stars
- 35.8k
- Forks
- 846
- Avg merge
- 27m
- Merged PRs (30d)
- 3
Description
## Summary
Please consider adding a formatter option that controls how single-value attributes are rendered by `just --fmt`.
At present, `just --fmt` unconditionally converts colon-separated single-value attributes to the function-style syntax. For example:
```just
[doc: "doc"]
[group: "group"]
```
is formatted as:
```just
[doc("doc")]
[group("group")]
```
## Proposed behavior
A formatter option could allow users to select the preferred syntax for single-value attributes. For example, users could choose between:
```just
[doc: "doc"]
```
and:
```just
[doc("doc")]
```
The exact option name and syntax are open for discussion. Possible approaches include a command-line option, a configuration setting, or a formatter-specific setting in the justfile.
Contributor guide
Research direction
Start by examining the existing `just --fmt` behavior described in the issue and how users currently configure formatter behavior. The option name and whether it belongs on the command line, in configuration, or in the justfile are unresolved; clarify that design before implementation. Done means users can select either syntax for single-value attributes and formatting preserves their preference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100