From 7949692a61dd092b6c5c34c31321f54f2a869387 Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Mon, 17 Mar 2025 11:49:31 -0700 Subject: [PATCH] Add a note about not preserving comments and whitespace The decision in https://github.com/dtolnay/prettyplease/issues/50 was surprising to me, as I did not expect a formatting API to erase comments. Hopefully this comment helps someone else catch this behavior before they mistakenly erase comments from their generated code! :) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 4584c48..7a3225e 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ The tradeoffs made by this crate are a good fit for generated code that you will output of `cargo-expand`. In those cases it's more important that the whole thing be formattable without the formatter giving up, than that it be flawless. +Note that this crate does not support preserving non-doc comments or whitespace. +
## Feature matrix @@ -58,6 +60,7 @@ detail comparing the output of each of these libraries. | published to crates.io | 💚 | ❌ | ❌ | | extensively configurable output | ❌ | ❌ | 💚 | | intended to accommodate hand-maintained source code | ❌ | ❌ | 💚 | +| preserves comments and whitespace | ❌ | 💚 | 💚 |