4 ms·
A lot of languages do have auto formatters with opinionated defaults for this. For go, gofmt is so opinionated that you can't even configure it, which is kinda
by p1necone 4y ago
A lot of languages do have auto formatters with opinionated defaults for this.
For go, gofmt is so opinionated that you can't even configure it, which is kinda cool because it means all go code that uses it will look the same.
There's also rustfmt for rust and prettier for JS/TS (and I assume similar for lots of other languages I'm not familiar with), both of which are configurable, which I prefer - but I can see the upsides of a one-size-fits-all code formatting tool (especially for a language like go where a reasonably constrained feature set/syntax is an explicit goal of the language).
- occamrazor 4y agoPython has black, also not configurable.
- avryhof 4y agoBlack is pretty nice with the defaults, but it certainly is configurable these days. It can take command line options, or it can be configured in your Poetry pyproject.toml file. https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html https://black.readthedocs.io/en/stable/usage_and_configurati...