foundry-pre-commit
foundry-pre-commit copied to clipboard
🛠️🪝 Pre-commit hooks for foundry forge fmt and snapshot.
🛠️ Foundry Pre-Commit Hook 🪝
Run Foundry forge fmt and/or forge snahshot before
commit.
Usage
- Install Foundry.
- Install
pre-commit. - Add the following to
.pre-commit-config.yamlin your repo.
repos:
- repo: https://github.com/0xYYY/foundry-pre-commit
rev: v1.0.0
hooks:
- id: format
- id: snapshot
- Run
pre-commit installto set up the hooks. - 🎉 From now on, before each commit,
forge fmtandforge snapshotwill be ran automatically.
Credits
Inspired by this tweet from devanoneth.
License
Dual licensed under either MIT License or Apache License, Version 2.0.