projectfluent / fluent-rs

Rust implementation of Project Fluent
https://projectfluent.org
Apache License 2.0
1.04k stars 95 forks source link

Add a github workflow to run rust fmt #289

Closed gybrish closed 1 year ago

gybrish commented 1 year ago

Resolves #288

Tested locally with act:

[Rustfmt/format]   🐳  docker exec cmd=[node /var/run/act/actions/mbrobbel-rustfmt-check@master/dist/index.js] user= workdir=
| [command]/root/.cargo/bin/cargo + fmt -- -l
[Rustfmt/format]   ✅  Success - Main mbrobbel/rustfmt-check@master
[Rustfmt/format] 🏁  Job succeeded
gybrish commented 1 year ago

I think we should be good now!

I had some trivial dry run tests locally, just messed with the formatting to make sure the check was working correctly:

|      type Item = &'a I::Item;
|      type IntoIter = CacheIter<'a, I, R>;
|
| -    fn into_iter(self) -> Self::IntoIter {CacheIter {
| +    fn into_iter(self) -> Self::IntoIter {
| +        CacheIter {
|              cache: self,
|              curr: 0,
|          }
[Rustfmt/format]   ❌  Failure - Main Run rustfmt
[Rustfmt/format] exitcode '1': failure
[Rustfmt/format] 🏁  Job failed
gregtatum commented 1 year ago

And it's merged, thanks for your contribution!