PRQL / prql

PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement
https://prql-lang.org
Apache License 2.0
9.65k stars 208 forks source link

style: Sort imports #4522

Closed max-sixty closed 1 month ago

max-sixty commented 1 month ago

Currently our imports are kinda all over. This uses an unstable feature to sort them into groups. While it's not possible to run this on every commit, hopefully having them in groups makes it easier to maintain.

To re-run:

echo 'group_imports = "StdExternalCrate"' > rustfmt.toml
cargo +nightly fmt

...and when the feature is made stable, then we can enable it...

max-sixty commented 1 month ago

(inspired by @m-span's sorting, feedback welcome)

max-sixty commented 1 month ago

I'll merge since I don't think there's much downside. If there are merge conflicts, accepting both and running the command above + cargo clippy should sort everything out (let me know if not, happy to help)

m-span commented 1 month ago

I occasionally sort imports in RustRover using a built in tool (Code > Optimize Imports), but I prefer your approach here to use rustfmt