Skip to content

Commit

Permalink
Auto merge of #12836 - epage:fmt, r=weihanglo
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Oct 17, 2023
2 parents f806be2 + b5c63f6 commit 4cf7937
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/doc/contrib/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [New subcommands](./implementation/subcommands.md)
- [Console Output](./implementation/console.md)
- [Filesystem](./implementation/filesystem.md)
- [Formatting](./implementation/formatting.md)
- [Debugging](./implementation/debugging.md)
- [Tests](./tests/index.md)
- [Running Tests](./tests/running.md)
Expand Down
17 changes: 17 additions & 0 deletions src/doc/contrib/src/implementation/formatting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Formatting

When modifying user files, like `Cargo.toml`, we should not change other
sections of the file,
preserving the general formatting.
This includes the table, inline-table, or array that a field is being edited in.

When adding new entries, they do not need to match the canonical style of the
document but can use the default formatting.
If the entry is already sorted, preserving the sort order is preferred.

When removing entries,
comments on the same line should be removed but comments on following lines
should be preserved.

Inconsistencies in style after making a change are left to the user and their
preferred auto-formatter.

0 comments on commit 4cf7937

Please sign in to comment.