Run Foundry forge fmt
and/or forge snahshot
before
commit.
- Install Foundry.
- Install
pre-commit
. - Add the following to
.pre-commit-config.yaml
in your repo.
repos:
- repo: https://github.com/0xYYY/foundry-pre-commit
rev: v1.0.0
hooks:
- id: format
- id: snapshot
- Run
pre-commit install
to set up the hooks. - ๐ From now on, before each commit,
forge fmt
andforge snapshot
will be ran automatically.
Inspired by this tweet from devanoneth.
Dual licensed under either MIT License or Apache License, Version 2.0.