style: Collapse hard-wrapped Markdown prose to one line per paragraph - #8158
style: Collapse hard-wrapped Markdown prose to one line per paragraph#8158mvadari wants to merge 2 commits into
Conversation
Set prettier's proseWrap to never for Markdown files so paragraphs are written and formatted as a single line rather than manually wrapped at a fixed column, matching the convention already used in AGENTS.md.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
proseWrap:never collapsed each `> [!NOTE]`-style blockquote onto its body line, which breaks GitHub/GitLab's alert-callout rendering (the marker must be alone on the blockquote's first line). Mark each one with a prettier-ignore comment so prettier leaves it split across two lines, and fix two more instances the review missed (CONTRIBUTING.md, docs/build/advanced_conan.md).
There was a problem hiding this comment.
Pure documentation reflow driven by a new prettier proseWrap=never rule scoped to *.md files. Diffs are mechanical (hard-wrapped prose collapsed to single lines); no code, logic, or config-wiring changes are present in the shown hunks. Nothing to flag.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
🟡 Changes recommended
The new Prettier override uses a glob that won’t match Markdown files in subdirectories (so the repo-wide enforcement goal isn’t met), and there are a few fixable typos/punctuation issues in touched docs.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR standardizes Markdown formatting across the repo by disabling hard-wrapping for prose (one line per paragraph) via Prettier configuration, and then reformatting existing Markdown files accordingly to reduce noisy diffs on small edits.
Changes:
- Add a Prettier override intended to set
proseWrap: neverfor Markdown files. - Reflow existing hard-wrapped Markdown prose across docs/READMEs into single-line paragraphs.
- Apply related Markdown formatting normalization (including some tables and admonition blocks) to match the new convention.
File summaries
| File | Description |
|---|---|
| tests/README.md | Reflow prose paragraphs to single-line-per-paragraph. |
| src/xrpld/rpc/README.md | Reflow prose paragraphs to single-line-per-paragraph. |
| src/xrpld/peerfinder/README.md | Reflow prose paragraphs/lists to single-line-per-paragraph. |
| src/xrpld/app/rdb/README.md | Reflow table formatting and prose. |
| src/xrpld/app/misc/README.md | Reflow prose paragraphs/lists to single-line-per-paragraph. |
| src/xrpld/app/ledger/README.md | Reflow prose paragraphs to single-line-per-paragraph. |
| src/xrpld/app/consensus/README.md | Reflow prose and bullet formatting. |
| src/tests/README.md | Reflow prose paragraphs to single-line-per-paragraph. |
| src/tests/libxrpl/csf/README.md | Reflow prose and explanatory paragraphs to single-line-per-paragraph. |
| src/test/README.md | Reflow prose paragraphs to single-line-per-paragraph. |
| README.md | Reflow prose paragraphs to single-line-per-paragraph. |
| package/README.md | Reflow prose and table formatting to single-line-per-paragraph. |
| nix/docker/README.md | Reflow prose and tables to single-line-per-paragraph. |
| nix/check-tools/README.md | Reflow prose to single-line-per-paragraph. |
| LICENSE.md | Reflow license text into single-line paragraphs. |
| include/xrpl/shamap/README.md | Reflow prose to single-line-per-paragraph. |
| include/xrpl/resource/README.md | Reflow prose to single-line-per-paragraph. |
| include/xrpl/protocol/README.md | Reflow prose to single-line-per-paragraph. |
| include/xrpl/protocol_autogen/README.md | Reflow prose to single-line-per-paragraph. |
| include/xrpl/proto/README.md | Reflow prose to single-line-per-paragraph. |
| include/xrpl/proto/org/xrpl/rpc/v1/README.md | Reflow prose to single-line-per-paragraph. |
| include/xrpl/nodestore/README.md | Reflow prose to single-line-per-paragraph. |
| include/xrpl/crypto/README.md | Reflow prose to single-line-per-paragraph. |
| include/xrpl/consensus/README.md | Reflow prose to single-line-per-paragraph. |
| include/xrpl/basics/README.md | Reflow prose to single-line-per-paragraph. |
| docs/install.md | Reflow prose and adjust admonition blocks alongside the new wrapping behavior. |
| docs/install-legacy.md | Reflow prose and adjust admonition blocks alongside the new wrapping behavior. |
| docs/HeapProfiling.md | Reflow prose to single-line-per-paragraph. |
| docs/CodingStyle.md | Reflow prose and list items to single-line-per-paragraph. |
| docs/build/sanitizers.md | Reflow prose and admonition blocks to single-line-per-paragraph. |
| docs/build/nix.md | Reflow prose and admonition blocks to single-line-per-paragraph. |
| docs/build/nix_troubleshooting.md | Reflow prose and admonition blocks to single-line-per-paragraph. |
| docs/build/environment.md | Reflow prose to single-line-per-paragraph. |
| docs/build/depend.md | Reflow prose to single-line-per-paragraph. |
| docs/build/conan.md | Reflow prose to single-line-per-paragraph. |
| docs/build/advanced_conan.md | Reflow prose and admonition blocks to single-line-per-paragraph. |
| docs/0010-ledger-replay/README.md | Reflow prose to single-line-per-paragraph. |
| conan/lockfile/README.md | Reflow prose to single-line-per-paragraph. |
| BUILD.md | Reflow prose and tables to single-line-per-paragraph. |
| API-VERSION-2.md | Reflow prose to single-line-per-paragraph. |
| API-CHANGELOG.md | Reflow prose to single-line-per-paragraph. |
| .prettierrc.yaml | Add Prettier config intended to enforce proseWrap: never for Markdown. |
| .github/scripts/rename/README.md | Reflow prose to single-line-per-paragraph. |
| .github/scripts/levelization/README.md | Reflow prose and tables to single-line-per-paragraph. |
Review details
- Files reviewed: 49/49 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # preserving manual line breaks (the prettier default). Scoped to Markdown | ||
| # only, since proseWrap also reflows YAML block scalars. | ||
| overrides: | ||
| - files: "*.md" |
| `SHAMapLeafNode` is an abstract class which publicly inherits directly from | ||
| `SHAMapTreeNode`. It isIt holds the | ||
| following data: | ||
| `SHAMapLeafNode` is an abstract class which publicly inherits directly from `SHAMapTreeNode`. It isIt holds the following data: |
| as a validator (the default) to running as a tracking peer. The [`Peer` | ||
| class](./Peer.h) has a variety of configurable parameters that control how it | ||
| behaves during the simulation. | ||
| The simulation code starts by creating a single instance of the [`Sim` class](./Sim.h). This class is used to manage the overall simulation and internally owns most other components, including the `Peer`s, `Scheduler`, `BasicNetwork` and `TrustGraph`. The next two lines create two differ `PeerGroup`s of size 5 and 1 . A [`PeerGroup`](./PeerGroup.h) is a convenient way for configuring a set of related peers together and internally has a vector of pointers to the `Peer`s which are owned by the `Sim`. `PeerGroup`s can be combined using `+/-` operators to configure more complex relationships of nodes as shown by `PeerGroup network`. Note that each call to `createGroup` adds that many new `Peer`s to the simulation, but does not specify any trust or network relationships for the new `Peer`s. |
| - `RCLConsensus` is implements the requirements of the generic | ||
| `Consensus` class by connecting to the rest of the `xrpld` | ||
| application. | ||
| - `RCLConsensus` is implements the requirements of the generic `Consensus` class by connecting to the rest of the `xrpld` application. |
| closed ledger. This is a consequence of Byzantanine failure. The purpose of | ||
| validations is to resolve the differences between servers and come to a common | ||
| conclusion about which last closed ledger is authoritative. | ||
| The most recent ledger that the server believes the network reached consensus on. Different servers can arrive at a different conclusion about the last closed ledger. This is a consequence of Byzantanine failure. The purpose of validations is to resolve the differences between servers and come to a common conclusion about which last closed ledger is authoritative. |
High Level Overview of Change
Set prettier's
proseWraptoneverfor Markdown files (via a new.prettierrc.yaml, scoped so it doesn't also reflow YAML block scalars), and reflow all existing hard-wrapped Markdown prose to one paragraph per line as a result. This matches the convention already adopted inAGENTS.md/CONTRIBUTING.mdin #8067, and makes it automatic going forward instead of relying on someone remembering to do it by hand.Note: if we prefer wrapping the prose to a certain length, I'm fine with that - just want it to be consistent.
Context of Change
Single-line paragraphs diff more cleanly than hard-wrapped ones (a one-word edit no longer reflows the whole paragraph), and #8067 had already reflowed
AGENTS.md/CONTRIBUTING.mdmanually to follow this style. This PR encodes it as apre-commit/prettierrule so it applies repo-wide and stays enforced.API Impact
N/A
Test Plan
pre-commit run --all-filespasses.docs/CodingStyle.md,README.md) — only prose paragraphs collapsed; tables, lists, and code blocks untouched.