transmissions11 / foundry-template

Streamlined template for getting started with Foundry and Solmate.
MIT License
163 stars 26 forks source link

📝 forge fmt and forge snapshot pre-commit hook #7

Open devanoneth opened 1 year ago

devanoneth commented 1 year ago

Do you rate the hook?

transmissions11 commented 1 year ago

Oh this is dope, can we make it pre-installed so u don't need to run cp?

devanoneth commented 1 year ago

Unfortunately git hooks must be stored somewhere else and then effectively installed on each local developers' cloned repo. You can't commit the file at .git/hooks/pre-commit.

In JS land it's common to have a postinstall step that runs automatically after npm install which installs your hooks so as a dev you don't even notice it.

I did consider that because Foundry is trying to become a feature complete tool, we could have Foundry install them as part of forge install 👀

What do you think? Maybe worth ccing @gakonst

gakonst commented 1 year ago

Down to include by default with easy option to opt out.