foundry-template icon indicating copy to clipboard operation
foundry-template copied to clipboard

📝 forge fmt and forge snapshot pre-commit hook

Open devanoneth opened this issue 3 years ago • 3 comments

Do you rate the hook?

devanoneth avatar Nov 11 '22 06:11 devanoneth

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

transmissions11 avatar Nov 11 '22 16:11 transmissions11

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

devanoneth avatar Nov 11 '22 20:11 devanoneth

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

gakonst avatar Nov 12 '22 00:11 gakonst