-
Notifications
You must be signed in to change notification settings - Fork 429
Enforce formatting of code examples in Bevy book #279
Copy link
Copy link
Closed
Labels
A-BookA-Build-SystemS-Ready-For-ImplementationThe core questions are answered: just add codeThe core questions are answered: just add code
Milestone
Description
It can be quite challenging to maintain an appropriately consistent style when writing code snippets for examples. Indentation errors, offset parentheses and so on reduce the perception of quality to new readers, and distract from the learning experience.
Fortunately, cargo fmt is very good. We should ensure that submitted code passes cargo fmt. This is very closely related to #83, and we should ensure that the solution we select for that can be extended to fit this.
Ideally, this process is also easy for authors to use. We probably won't be able to use cargo fmt directly, as the Rust files are embedded inside markdown, but a script that applies the formatting to all code blocks and can be run on command would be massively appreciated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-BookA-Build-SystemS-Ready-For-ImplementationThe core questions are answered: just add codeThe core questions are answered: just add code