Description
In the short-term, we need ways to experiment with how Rustfmt formats. However, what should the long term look like? There are wins if all code looks the same in terms of adjusting to new projects, and this approach is taken by Gofmt. On the other hand, we can never please everyone with a single formatting style, and people using Rustfmt with different styles is better than people not using Rustfmt at all (and the Rust community is not as 'conformant' as the Go community); this approach is taken by ClangFormat.
Currently, we have a rustfmt.toml file with many disparate options. If we do decide to keep some customisation, we should at the least decide on a strategy for what kind of options we want to present and how they are organised.
Finally, we have some options for introducing 'speed bumps' to customisation, we could:
- only allow customisation on nightly (vs stable or beta), this somewhat follows stabilisation policy for Rust)
- only allow customisation on Rustfmt build from source, rather than from distributed binaries
- only allow customisation of
rustfmt
, but notcargo fmt
(I think this one is a terrible idea, but brain-storming...) - opt-in to customisation with a command line argument or environment variable
- rustfmt distributed with Rust (some day, assuming this happens) does not permit customisation, but you can download a separate version which does.
- sure there are others
The idea with these speed bumps is we more strongly encourage users to use the default formatting, but permit customisation where it is necessary (e.g., corporate pressure, interaction with existing codebases, bloody-mindedness)