Skip to content

Enforce formatting of code examples in Bevy book #279

@alice-i-cecile

Description

@alice-i-cecile

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions