I'm looking for a way to introduce rustfmt into a CI pipeline, without forcing a one-big rustfmt event.
One idea that I had was to ignore formatting errors if a given file was already not correctly formatted (before the change under test). This way there would something preventing formatting from getting worse, but in a slower and more gentle way.
Is anyone aware of an existing project like that? Or any other projects/ideas aiming at similar goal?
I do something similar to "every module is documented" condition.
There's a poorly_documented list which stores all yet undocumented module. There's a test which checks ∀ m ∈ Modules: documented(m) == m ∉ poorly_documented. That is, the test fails when the new undocumented module is added, or when an old module gets documented. The poorly_documented list is maintained manually, and initially included almost all modules.
Note that this requires that you run rustfmt from a #[test] rather than as a separate CI step, but I believe this is a good idea regardless.