Skip to content

Commit 4cf7937

Browse files
committed
Auto merge of #12836 - epage:fmt, r=weihanglo
docs(contrib): Policy on manifest editing Based on https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Automatic.20edits.20to.20.60Cargo.2Ctoml.60
2 parents f806be2 + b5c63f6 commit 4cf7937

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/doc/contrib/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- [New subcommands](./implementation/subcommands.md)
1515
- [Console Output](./implementation/console.md)
1616
- [Filesystem](./implementation/filesystem.md)
17+
- [Formatting](./implementation/formatting.md)
1718
- [Debugging](./implementation/debugging.md)
1819
- [Tests](./tests/index.md)
1920
- [Running Tests](./tests/running.md)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Formatting
2+
3+
When modifying user files, like `Cargo.toml`, we should not change other
4+
sections of the file,
5+
preserving the general formatting.
6+
This includes the table, inline-table, or array that a field is being edited in.
7+
8+
When adding new entries, they do not need to match the canonical style of the
9+
document but can use the default formatting.
10+
If the entry is already sorted, preserving the sort order is preferred.
11+
12+
When removing entries,
13+
comments on the same line should be removed but comments on following lines
14+
should be preserved.
15+
16+
Inconsistencies in style after making a change are left to the user and their
17+
preferred auto-formatter.

0 commit comments

Comments
 (0)