diff --git a/content/wiki/formatting_scheme.md b/content/wiki/formatting_scheme.md index e0e1ad5..91cf0c2 100644 --- a/content/wiki/formatting_scheme.md +++ b/content/wiki/formatting_scheme.md @@ -21,9 +21,24 @@ Shaders are usually licensed under the former two licenses OR the Unlicense. Most Linebender projects files are written in Rust. For those files, the formatting produced by `rustfmt` is required. +The following rustfmt config is recommended: + +```toml +# LINEBENDER RUSTFMT CONFIG - v1 +# Ensure lines end with \n even if the git configuration core.autocrlf is not set to true +newline_style = "Unix" + +# `Foobar { foo, bar }` is more readable than `Foo { foo: foo, bar: bar }` +use_field_init_shorthand = true + +# Commented out because it is still unstable, but works fine in practice. +# imports_granularity = "Module" + +# END LINEBENDER RUSTFMT CONFIG +``` + ## Markdown In Markdown files, every paragraph should have one line per sentence. This makes git diff easier to read. [[1]](https://nick.groenen.me/notes/one-sentence-per-line/) [[2]](https://sive.rs/1s) -