chore: rustfmt rules on nightly#33
Conversation
Signed-off-by: tison <[email protected]>
|
I used to love this idea and even implemented it in several projects. However, I eventually came to realize that developing with the nightly toolchain is not a pleasant experience. In hindsight, I believe it’s better to deal with occasional conflicts, which are rare, rather than constantly struggling with the nightly toolchain. |
@Xuanwo Is it helpful? Or you're facing other challenges. |
notfilippo
left a comment
There was a problem hiding this comment.
For other reviewers, the real change is just in rustfmt.toml.
IMO I think it's fine to use nightly for devtools and stable for compilation.
|
@freakyzoidberg / @leerho feel free to merge this :) |
@notfilippo Thanks for your review! What do you think of this part? |
|
Let's do it @tisonkun ! Can you create an issue? |
cc @notfilippo @Xuanwo
I'm trying to bring some useful format rules used in most of my projects: keep comments and imports consistent. Especially, unformatted imports can be a major source of unexpected patch conflicts.
However, most of the new rules require a nightly toolchain to enable, which means a pre-commit-like hook is needed for contributors to run the formatter - it's not quite straightforward.
I'm considering introducing a xtask-style dev tool and perhaps moving the main
datasketchescrate to a member of a workspace. (then we can have something likecargo x lintto apply all the rules instead of letting contributors know what is configured in the CI workflow)The other reason for adopting a workspace layout is that I'm considering bringing a binary target that can generate snapshots by the Rust implementation so that other languages' implementations can use it to test cross-language compatibility from Rust to theirs.
What do you think?