mesalock-linux / mesabox

A collection of core system utilities written in Rust for Unix-like systems (and now Windows)
BSD 3-Clause "New" or "Revised" License
137 stars 19 forks source link

`cargo fmt` does very little #36

Closed Arcterus closed 6 years ago

Arcterus commented 6 years ago

Because all the utilities are included dynamically using macros, cargo fmt only formats the stuff like src/setup.rs and src/util.rs.

I also think we should configure the formatting, as sometimes the output looks worse/is harder to read than the input with the current settings.

mssun commented 6 years ago

OK, let's have our own configuration.

I'm happy with all default config for now (https://github.com/rust-lang-nursery/rustfmt/blob/master/Configurations.md), but please define the rustfmt.toml file to specify your preference.

Because all the utilities are included dynamically using macros, cargo fmt only formats the stuff like src/setup.rs and src/util.rs.

Do you mean that we should specify files we'd like to format? Like cargo fmt -- `find libmesabox -iname "*.rs"`?

Arcterus commented 6 years ago

Yeah, we need to do something like that probably. I'm not sure if running cargo fmt will work or if we need to use rustfmt directly.

mssun commented 6 years ago

Fixed in: https://github.com/mesalock-linux/mesabox/commit/679459afd359b779b43649e0e2f4525735d6cf4b

We don't enforce fmt and clippy for now, but it will be tested in the CI. Once we have a clear style, fmt is necessary for collaboration.