exercism / v3

The work-in-progress project for developing v3 tracks
https://v3.exercism.io
Other
170 stars 163 forks source link

[rust] validate example.rs formatting #2971

Closed ghost closed 3 years ago

ghost commented 3 years ago

This asserts the example.rs file has been formatted using cargo fmt. It avoids doing the change since test_pr.sh exists for our manual benefit. Next steps would be to codify this into a GitHub action.

coriolinus commented 3 years ago

It may be useful to look at prior art in v2 doing precisely this.

In general my preference is to encode distinct steps as distinct checks. As currently written, a PR which fails the rustfmt check would fail fast without attempting to compile or test it. It exposes more useful information to the PR author if formatting can fail independently of testing.

ghost commented 3 years ago

@coriolinus I agree this could be much better but I'm looking for an expedient solution to aid development. This was the first way I found how to do this. As a contributor, I would like to focus on the concept exercises and not worry about formatting or operations. If you prefer creating a more resilient approach, could you create an issue in the v3 repository? Then, I'll close this and that issue can cover the more rounded solution.