Skip to content

Commit b3dbbf7

Browse files
PoignardAzurxStromDJMcNab
authored
Add a canonical rustfmt config (#86)
Co-authored-by: Kaur Kuut <[email protected]> Co-authored-by: Daniel McNab <[email protected]>
1 parent f8b5489 commit b3dbbf7

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

content/wiki/formatting_scheme.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,24 @@ Shaders are usually licensed under the former two licenses OR the Unlicense.
2121
Most Linebender projects files are written in Rust.
2222
For those files, the formatting produced by `rustfmt` is required.
2323

24+
The following rustfmt config is recommended:
25+
26+
```toml
27+
# LINEBENDER RUSTFMT CONFIG - v1
28+
# Ensure lines end with \n even if the git configuration core.autocrlf is not set to true
29+
newline_style = "Unix"
30+
31+
# `Foobar { foo, bar }` is more readable than `Foo { foo: foo, bar: bar }`
32+
use_field_init_shorthand = true
33+
34+
# Commented out because it is still unstable, but works fine in practice.
35+
# imports_granularity = "Module"
36+
37+
# END LINEBENDER RUSTFMT CONFIG
38+
```
39+
2440
## Markdown
2541

2642
In Markdown files, every paragraph should have one line per sentence.
2743
This makes git diff easier to read.
2844
[[1]](https://nick.groenen.me/notes/one-sentence-per-line/) [[2]](https://sive.rs/1s)
29-

0 commit comments

Comments
 (0)