Skip to content

Commit

Permalink
docs: update swayfmt contributing (FuelLabs#3936)
Browse files Browse the repository at this point in the history
prompts the contributor within the `swayfmt` contributing guide to run
the test suite as well as use the test suite as a guide on how to write
tests.
  • Loading branch information
eightfilms authored Jan 31, 2023
1 parent d0e8344 commit e06ddd5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion swayfmt/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,21 @@ cargo build --path ~/sway/forc-plugins/forc-fmt/Cargo.toml && mv ~/sway/target/d

## Testing

Be sure to have `forc` installed then move into a Sway project directory and execute the binary:
You should test your changes both using the test suite as well as manually.

Before you make changes, let's ensure that the test suite runs fine:

```sh
# from the root
cd swayfmt && cargo test
```

`swayfmt` has an extensive test suite that should pass both locally and within the CI to ensure reliability. This is used
to ensure that there isn't regression introduced along with new changes. If your changes include fixing bugs or adding
a new feature, please also include new tests accompanying your PR where possible. You may look at [formatter/mod.rs](https://github.com/FuelLabs/sway/blob/master/swayfmt/src/formatter/mod.rs)
for examples on how you may test your changes.

To manually test the formatter, be sure to have `forc` installed then move into a Sway project directory and execute the binary:

```sh
forc fmt
Expand Down

0 comments on commit e06ddd5

Please sign in to comment.