3 ms·
I agree 100%. So much so, that I think every professional language should have it. Every tab, newline and space one has to do manually is lost effort. It still
by Ciantic 5y ago
I agree 100%. So much so, that I think every professional language should have it. Every tab, newline and space one has to do manually is lost effort.
It still amazes me that C# doesn't have good opinionated formatter. It has lot of non-opinionated formatters, but I found one: Csharpier [1], check it out. It's slow, but at least the author is trying.
[1]: https://github.com/belav/csharpier https://github.com/belav/csharpier
- belav 5y agoI am curious what you mean by slow. CSharpier started as a prettier plugin, and it was definitely slow then. ~30 minutes for a project with around 10k files if I remember correctly and the formatting was just barely implemented. At this point it is ~40s without --fast, or ~27s with it. CSharpier is stable enough that I should make --fast the default option. Individual file formatting is a bit slow which is the overhead of starting up a new .Net console app every time. NativeAOT is a potential solution, but probably not until .net7. Building plugins that keep csharpier running in the background and piping files to it is the other option. That is one of the next things on my list.