TOML files are inconsistently formatted
There's inconsistencies, in particular whitespace and ordering, in our Cargo.toml files
We should look into TOML formatting solutions and enforce in CI, to reduce unnecessary merge conflicts
Yes I observe they need formatting accordingly one after the order and documenting how this can be treated in the future. I will love to work on this to get our TOML files clean and sorted.
Thanks @Cyber-Lord! I assigned you.
I did zero research on viable solutions, so it would be great if you could summarize and we could discuss the available options here before opening a PR
Hi @nothingmuch,
I did a research on available formatting tools for TOML files, especially Cargo.toml. And I found this tools worth reviewing:
- Taplo: A versatile, feature-rich TOML toolkit. It is actively maintained, supports formatting and linting, and integrates well with CI.
- cargo-sort: Cargo-sort crate can help us sort dependencies alphabetically in Cargo.toml.
This 2 tools when combined will achieve the desired result since it formats TOML files automatically and can be run from command line, we will end up with clean TOML files.
We can also update the CI file and add taplo format --check to enforce formatting. Let me know what you think about this approach.
Thank you