Skip to content

Instantly share code, notes, and snippets.

@devanoneth
devanoneth / pre-commit
Created November 11, 2022 04:11
Pre-commit hook for Foundry
#!/bin/bash
BWHITE='\033[1;37m'
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
printf "Running ${BWHITE}forge fmt${NC}... \n"
if forge fmt &>/dev/null; then
printf "${GREEN}Formatted!${NC} \n"