I believe all you already read the reply from the devtools team lead https://github.com/rust-lang/rustfmt/issues/6678#issuecomment-3382819708
Not necessarily applicable to just rustfmt, but software often suffers from the "last known commit xyz time ago" issue. If a project is functional and mostly complete, is it an issue?
A lot of what Linus complained about is 100% valid though. I prefer the default formatting style for myself, but in a codebase this massive, merging things becomes a pain quite fast
If a project is functional and mostly complete, is it an issue?
I get the sentiment, but if you have 200+ open PRs by dozens of authors, the community obviously doesn't agree that is compete.
If a project is functional and mostly complete, is it an issue?
How can a language formatter be considered complete is the language it is targeting keeps getting updates?
Depends on whether those changes break the formatting.
A lot of what Linus complained about is 100% valid though
Not necessarily. The program can be configured and they did not create a default configuration for all, to enforce a specific style. Linus can complain about the default settings, but that does not make sense if we look at all other tooling used in Linux. Are they using every application with default settings and then complain about it?
No, there are settings adapted for the Kernel and their workflow. And they did not do that with rustfmt. While the critique about the issue itself is valid, its not valid to complain about it about the program. He should have complained about those responsible for the default configuration in Linux.
I do think they should have taken an approach similar to prettier and gofmt. very minimal settings and opinionated so all js/go codebases are effectively the same formatting
They do. Linus just doesn't like the default settings.
Neither do I, but I don't like the KDE formatting either, so it doesn't really matter as much.
Is this a typo? What do you mean by KDE formatting?
I mean the clang-format
in KDE code.
I work with it, I don't like it, but I like KDE, so I put up with the formatting that I don't like.
Ahh, I see. Well okay, you don't have to like it. But that is not the problem of the default configuration, but the problem of those who accept it as the formatting in the project. You don't like what the KDE code formatting project does, and that's the issue. Working in teams it will obviously happen at some point that you don't like what the team accepted as formatting. This is not a specific issue with KDE or rustfmt.
BTW, wouldn't it work to have your personal rustfmt configuration that you like and work with and when you are done and want to git push, it would automatically reformat with rustfmt using the teams formatting? I personally don't work in teams, so no idea if this is a viable option to do if you really dislike what they use.
I considered that (talking about clang-format here, not rustfmt), but there are cases where some files are formatted while others are not, such that, you can't go around formatting the whole project to your liking and then expect it to return to the same, once you go back to the project's configuration, for committing.
Here, the difference between clang-format
and rustfmt
comes up, because unlike clang-format
, which has the required configurations, rustfmt
does not have the configuration I require. The little part that is there, has not been fully implemented and a lot of the configuration hasn't even been defined.
Meaning that even if I were to put the time into contributing to rustfmt
, I will soon reach a point where I will have to be setting up groundwork. That's where I will fail, because I am too new to Rust to be able to define formatting for undecided conditions, many of which I don't even know about yet.
TBH for personal projects it's almost perfect already. It produces consistent readable code. But yeah it's often not very "mergeable", which is much more important for massive projects with thousands of active committers.
@balsoft @SorteKanin Even if it has been almost perfect in production for years, it must be adapted to follow Rust's new features, there are still some experimental settings, and some features are not completely functional, notably formatting code in macros.
What I would give to have my attribute macros and their meta/params be formatted when they get unruly ๐
https://doc.rust-lang.org/style-guide/index.html#small-items
We leave it to individual tools to decide on exactly what small means. In particular, tools are free to use different definitions in different circumstances.
What does this mean?
What does Linus when he says rustfmtcheck
? cargo fmt check
? A util I can't find with a simple search? Maybe they have makefile targets or sth for it?
The concerns raised by Linus make sense to me, but should be simple to solve. The small items description already mentions variance, and the need for tools to decide. So shouldn't it be a simple configuration change?
I think it's a script they added to do some sort of check with rustfmt.
Rust
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)