Skip to content

Conversation

@tisonkun
Copy link
Member

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 datasketches crate to a member of a workspace. (then we can have something like cargo x lint to 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?

Signed-off-by: tison <wander4096@gmail.com>
@Xuanwo
Copy link
Member

Xuanwo commented Dec 20, 2025

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.

@tisonkun
Copy link
Member Author

tisonkun commented Dec 21, 2025

However, I eventually came to realize that developing with the nightly toolchain is not a pleasant experience.

rustfmt seldom changes, and clippy typically adds new rules we'd expect to evaluate from time to time. Surely another perspective is to move upstream to stabilize more rules, but I think part of the bad experience is because not all contributors share the same setup? This can be resolved by a dev tool that developers can apply a oneline formatting with cargo x lint --fix while internally the xtask use cargo +nightly ....

@Xuanwo Is it helpful? Or you're facing other challenges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants