From 79d1881846d3065b7c9c5043c9c670ed9524350d Mon Sep 17 00:00:00 2001
From: zerosnacks <zerosnacks@protonmail.com>
Date: Thu, 30 Jan 2025 15:23:54 +0100
Subject: [PATCH] update docs in accordance to
 https://github.com/foundry-rs/foundry/pull/9791 and
 https://github.com/foundry-rs/foundry/pull/9645

---
 src/cheatcodes/gas-snapshots.md | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/cheatcodes/gas-snapshots.md b/src/cheatcodes/gas-snapshots.md
index 2f3dc9974..4c0e6d2b9 100644
--- a/src/cheatcodes/gas-snapshots.md
+++ b/src/cheatcodes/gas-snapshots.md
@@ -38,11 +38,17 @@ function snapshotGasLastCall(string calldata group, string calldata name) extern
 
 `snapshotGas*` cheatcodes allow you to capture gas usage in your tests. This can be useful to track how much gas your logic is consuming. You can capture the gas usage of the last call by name, capture an arbitrary numerical value by name, or start and stop a snapshot capture of the current gas usage by name.
 
-In order to strictly compare gas usage across test runs, set the `FORGE_SNAPSHOT_CHECK` environment variable to `true` before running your tests. This will compare the gas usage of your tests against the last snapshot and fail if the gas usage has changed. By default the snapshots directory will be newly created and its contents removed before each test run to ensure no stale data is present.
+In order to strictly compare gas usage across test runs you can do one of the following:
 
-It is intended that the `snapshots` directory created when using the `snapshotGas*` cheatcodes is checked into version control. This allows you to track changes in gas usage over time and compare gas usage during code reviews.
+- Set the `FORGE_SNAPSHOT_CHECK=true` environment variable
+- Set `gas_snapshot_check` in `foundry.toml`
+- Pass `--gas-snapshot-check=true`
+
+By default this is not enabled and passing `--gas-snapshot-check=false` will override all others.
 
-When running `forge clean` the `snapshots` directory will be deleted.
+This will compare the gas usage of your tests against the last snapshot and fail if the gas usage has changed.
+
+It is intended that the `snapshots` directory created when using the `snapshotGas*` cheatcodes is checked into version control. This allows you to track changes in gas usage over time and compare gas usage during code reviews.
 
 ### Examples
 
@@ -68,7 +74,6 @@ contract SnapshotGasTest is Test {
 
 Capturing the gas usage of multiple sections of code that modify the internal state:
 
-
 ```solidity
 contract SnapshotGasTest is Test {
     uint256 public slot0;