chore: rustfmt rules on nightly #33
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?