Skip to content

Commit

Permalink
PR Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhynds committed Dec 5, 2023
1 parent 6ab7f59 commit ee439b0
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,13 @@ unset GIT_DIR
# Get changed files to be committed, excluding deleted files (since we can't grep them)
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=d)

STARTING_DIR=$(pwd)
APP_API_DIR="$GIT_ROOT/backend/app-api"
FRONTEND_DIR="$GIT_ROOT/frontend"
E2E_DIR="$GIT_ROOT/e2e-tests"

NO_FORMAT="\e[0m"
F_BOLD="\e[1m"
C_RED="\e[31m"
C_YELLOW="\e[93m"
C_CYAN="\e[36m"
C_LIME="\e[92m"

function on_script_finish_cleanup {
# Whether it passed or failed, undo any stateful changes.
cd "$STARTING_DIR"
}

# Rather than doing `return 1`, we fail fast.
function fail {
echo -e "${C_RED}${F_BOLD}Pre-commit hook failed! Fix the above errors before committing.${NO_FORMAT}"
Expand Down Expand Up @@ -127,8 +117,6 @@ function lint_php {

echo -e "${NO_FORMAT}${F_BOLD}Running pre-commit hook...${NO_FORMAT}"

trap on_script_finish_cleanup EXIT

skip_if_merge_in_progress
skip_if_no_changes

Expand Down

0 comments on commit ee439b0

Please sign in to comment.