twizzler-operating-system / twizzler

The Twizzler Operating System
BSD 3-Clause "New" or "Revised" License
62 stars 13 forks source link

Add automatic formatting via pre-commit hooks #179

Closed dbittman closed 2 months ago

dbittman commented 2 months ago

This PR is the first in a set that will add automatic formatting via pre-commit hooks and CI. Formatting is done by rustfmt, and is controlled by .rustfmt.toml.

I plan to apply the formatting changes that rustfmt wants in a separate PR, so as to limit all formatting changes to a single PR. Once the code is reformatted according to the rustfmt config we decide on, I'll update documentation to describe how to setup the pre-commit hook when contributing.

Starting this PR now so any bikeshedding discussion for rustfmt can be contained.

PandaZ3D commented 2 months ago

What version of rustfmt is going to be used? Does this matter?

dbittman commented 2 months ago

What version of rustfmt is going to be used? Does this matter?

I believe the rust-toolchain.toml file will clamp it to a specific nightly, like the bootstrap for xtask does. I don't think it's a huge deal.