Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Adds documentation of `disable-start` and `disable-end`. See foundry-rs#4998
  • Loading branch information
DJViau authored Oct 23, 2023
1 parent ba6c851 commit 5aa2da9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/fmt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5aa2da9

Please sign in to comment.