From 1e4737b0e1007f73f40360bb474aef88ada538cd Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Fri, 22 Sep 2023 07:36:11 +0000 Subject: [PATCH] remove pre-push hook --- --- a/.githooks/pre-push +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# Pre-push hook verifying that inappropriate code will not be pushed. - -# Colors for the terminal output -RED='\033[0;31m' -NC='\033[0m' # No Color - -# Check that prettier formatting rules are not violated. -if ! cargo fmt --check; then - echo -e "${RED}Push error!${NC}" - echo "Please format the code via 'cargo fmt', cannot push unformatted code" - exit 1 -fi - -STAGED_TEST_FILES=$(git diff --cached --name-only --diff-filter=ACM @{upstream}| grep ".ts$\|.js$") - -DIFF_EXIT="$?" - -if [[ "${DIFF_EXIT}" != 0 ]]; then - echo -e "${GREEN}eslint succeded${NC}" - exit 0 -fi - -if [[ "$STAGED_TEST_FILES" = "" ]]; then - echo -e "${GREEN}eslint succeded${NC}" - exit 0 -fi - -echo "Starting eslint.." -./tests/node_modules/.bin/eslint --max-warnings 0 ${STAGED_TEST_FILES[@]} -ESLINT_EXIT="$?" - -if [[ "${ESLINT_EXIT}" = 0 ]]; then - echo -e "${GREEN}eslint succeded${NC}" -else - echo -e "${RED}Commit error!${NC}" - echo "Please format the code via 'yarn fix', cannot Commit unformatted code" - exit 1 -fi - -exit $? -- gitstuff