From 5aa2da99825b8ad73ea736a081667bd135895490 Mon Sep 17 00:00:00 2001 From: Daniel Viau <14304708+DJViau@users.noreply.github.com> Date: Mon, 23 Oct 2023 12:02:25 -0400 Subject: [PATCH] Update README.md Adds documentation of `disable-start` and `disable-end`. See https://github.com/foundry-rs/foundry/issues/4998 --- crates/fmt/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/fmt/README.md b/crates/fmt/README.md index 7e51bf7f8a11..11e0c5ea3024 100644 --- a/crates/fmt/README.md +++ b/crates/fmt/README.md @@ -134,6 +134,17 @@ Alternatively, the comment can also be placed at the end of the line. In this ca uint x = 100; // forgefmt: disable-line ``` +### Disable Block + +The formatter can be disabled for a section of code by adding a comment `// forgefmt: disable-start` before and a comment `// forgefmt: disable-end` after, like this: + +```solidity +// forgefmt: disable-start +uint x = 100; +uint y = 101; +// forgefmt: disable-end +``` + ### Testing Tests reside under the `fmt/testdata` folder and specify the malformatted & expected Solidity code. The source code file is named `original.sol` and expected file(s) are named in a format `({prefix}.)?fmt.sol`. Multiple expected files are needed for tests covering available configuration options.