diff --git a/.githooks/pre-push b/.githooks/pre-push index 25312c14c106..73168e08ec42 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -7,8 +7,13 @@ RED='\033[0;31m' NC='\033[0m' # No Color # Check that prettier formatting rules are not violated. -if ! zk fmt --check; then - echo -e "${RED}Push error!${NC}" - echo "Please format the code via 'zk fmt', cannot push unformatted code" - exit 1 +if which zk_supervisor >/dev/null; then + if ! zk_supervisor fmt --check; then + echo -e "${RED}Push error!${NC}" + echo "Please format the code via 'zks fmt', cannot push unformatted code" + exit 1 + fi +else + echo "Please install zk_toolbox using zkup from https://github.com/matter-labs/zksync-era/tree/main/zk_toolbox/zkup, and then run ./bin/zkt from the zksync-era repository." + exit 1 fi diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index dba6efd2fdff..a712db9f75b4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -17,4 +17,4 @@ - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. -- [ ] Code has been formatted via `zk fmt` and `zk lint`. +- [ ] Code has been formatted via `zk_supervisor fmt` and `zk_supervisor lint`. diff --git a/bin/zkt b/bin/zkt index 36921dc4705b..f781ca67528b 100755 --- a/bin/zkt +++ b/bin/zkt @@ -5,6 +5,8 @@ cd $(dirname $0) if which zkup >/dev/null; then cargo uninstall zk_inception cargo uninstall zk_supervisor + git config --local core.hooksPath || + git config --local core.hooksPath ./.githooks zkup -p .. --alias else echo zkup is not installed, please install it https://github.com/matter-labs/zksync-era/tree/main/zk_toolbox/zkup