goformat
goformat | topiary | |
---|---|---|
7 | 3 | |
20 | 483 | |
- | 2.3% | |
0.0 | 8.8 | |
almost 6 years ago | 8 days ago | |
Go | Rust | |
BSD 3-clause "New" or "Revised" License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
goformat
-
Minimalist Rust formatter as an alternative to rustfmt?
Likewise, gofmt implementing what you argue for resulted in the creation of goformat. There's a limit to how much you can force people on these things and, more importantly, there are formatting decisions which are more than mere bikeshedding in the eyes of the programmers to the point where they consider it more productive to maintain the formatting by hand if that's what it takes.
-
Go is better than Rust (for networked server side applications meant for scale)?
I'm the guy who would only run rustfmt once every week or so, when my codebase was in a clean state where I could use git gui to cherry-pick the changes that were in line with my stubborn insistence on my own style and revert the rest. I'm also the guy who would have considered writing goformat if someone else didn't.
-
Why is rust so pedantic about code formatting and style?
Enough people disagree with that for goformat to exist.
-
rustfmt opt-in instead of opt-out
Same. I used to insist on cargo +nightly rustfmt and a massive stable of "I don't have a portrait-oriented monitor" rustfmt.toml tweaks which I'd only apply when I have a clean git gui on hand to cherry-pick away unwanted changes, but I've mellowed out and the rustfmt handling of things like assert! has evolved so, now, I just put use_small_heuristics = "Max" in my rustfmt.toml as an analogue to the people who choose goformat over gofmt.
-
Need a line-preserving gofmt tool
anyways, regardless of what I think, perhaps this library could help? Or at least be a good starting point to build your own: https://github.com/mbenkmann/goformat
-
What do you NOT like about Rust?
You'd prefer that people like me follow the road the Go ecosystem did and write goformat as a replacement for gofmt or just continue to hand-format everything?
-
Why most rustfmt options are still unstable?
Because Go syntax is ridiculously simple, there's not much room for opinion. And even considering that, there is already an alternative gofmt with custom options.
topiary
-
Show HN: GritQL, a Rust CLI for rewriting source code
You should check out https://github.com/tweag/topiary
Yes, theoretically if you had ~identical grammars you could use it to do a full transpilation. There's a lot of challenges with that though. Writing a correct grammar for 1 language is complicated enough, but writing one for two where all your nodes and fields end up the same is likely insurmountable.
In practice, languages are either:
- Far enough apart that any pure AST transformation is insufficient and you need an AI component to produce usable output
-
Elastic Tab Stops (2017)
This is something we've discussed[1] in the development of Topiary, deferring the process to the formatter. It's not a priority issue for us right now, but given the lack of universal editor support for elastic tab stops, having the formatter do this seems like a reasonable solution.
[1]: https://github.com/tweag/topiary/issues/170
-
Minimalist Rust formatter as an alternative to rustfmt?
build on top of https://github.com/tweag/topiary/blob/main/languages/rust.scm
What are some alternatives?
serenity - A Rust library for the Discord API.
prettier-plugin-rust - Prettier Rust is an opinionated code formatter that autocorrects bad syntax.
project-error-handling - Error handling project group
genemichaels - Even formats macros
rfcs - RFCs for changes to Rust
rustfmt - Format Rust code
prettyplease - A minimal `syn` syntax tree pretty-printer
rust-cpython - Rust <-> Python bindings
PyO3 - Rust bindings for the Python interpreter
puffin - 🐦 Friendly little instrumentation profiler for Rust 🦀