hrxi / tracing-loki

A tracing layer for shipping logs to Grafana Loki
Apache License 2.0
50 stars 20 forks source link

run cargo fmt #21

Closed gdesmott closed 1 year ago

gdesmott commented 1 year ago

Fix coding styles.

gdesmott commented 1 year ago

Needs a Github Actions CI check that the formatted code is actually cargo-fmt'ed, otherwise it'll get out of sync again.

I configured my editor (vscode) to automatically run rustfmt whenever a file is written, so I don't have to ever bother about this. It's quite handy.

hrxi commented 1 year ago

I configured my editor (vscode) to automatically run rustfmt whenever a file is written, so I don't have to ever bother about this. It's quite handy.

That solves the problem for you. I think this doesn't help on a shared project though. I won't be able to verify that a PR is cargo-fmt'ed by looking at it.

gdesmott commented 1 year ago

I think this doesn't help on a shared project though. I won't be able to verify that a PR is cargo-fmt'ed by looking at it.

Sure, I have a CI job checking formatting in all my projects. I'm more of a Gitlab person, but I think I may have something in system-dep's CI I could re-use.

gdesmott commented 1 year ago

Oh you already have some CI, then it's easy. Should be good but I can't run the CI pipeline myself. :\

gdesmott commented 1 year ago

Looks like rustfmt is not installed in the nightly image. Should we run it only on stable then?

hrxi commented 1 year ago

Looks like rustfmt is not installed in the nightly image. Should we run it only on stable then?

That would work, or you could install rustfmt as well: https://github.com/actions-rs/toolchain/tree/88dc2356392166efad76775c878094f4e83ff746#components. Both are fine.

gdesmott commented 1 year ago

I disabled it as I suppose nightly could require a different format because of changes in rustfmt.