#Is there something to pre-commit format?

2 messages · Page 1 of 1 (latest)

cedar prairie
#

I'd like to create GitHub workflow for auto formatting committed files.

feral mulch
#

I'm not aware of an easy way to do that though I suspect is it possible. The more common practice is to check that the code is already formatted (avoids having the CI modify the code, which complicates things). Some documentation in this is here: https://github.com/rust-lang/rustfmt#checking-style-on-a-ci-server . I often use format on save in my editor which prevents me from hitting such errors without extra work on my side.

GitHub

Format Rust code. Contribute to rust-lang/rustfmt development by creating an account on GitHub.