diff --git a/swayfmt/CONTRIBUTING.md b/swayfmt/CONTRIBUTING.md index a906f4fb3fc..fcdaa6eb923 100644 --- a/swayfmt/CONTRIBUTING.md +++ b/swayfmt/CONTRIBUTING.md @@ -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