Skip to content

Commit

Permalink
chore(qa): update git hooks for TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudcolas committed Jun 13, 2022
1 parent 5220e2b commit fd0122d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ PATCH_STAGED=$(git --no-pager diff --name-only --diff-filter=ACM $STAGED)
# Files which are fully staged.
FULLY_STAGED=$(comm -23 <(echo "$STAGED") <(echo "$PATCH_STAGED"))

JS_STAGED=$(grep -e '.js$' -e '.jsx$' <<< "$STAGED" || true)
JS_FULLY_STAGED=$(grep -e '.js$' -e '.jsx$' <<< "$FULLY_STAGED" || true)
PRETTIER_STAGED=$(grep -E '.(md|css|scss|js|json|yaml|yml|html)$' <<< "$STAGED" || true)
PRETTIER_FULLY_STAGED=$(grep -E '.(md|css|scss|js|json|yaml|yml|html)$' <<< "$FULLY_STAGED" || true)
JS_STAGED=$(grep -e '.js$' -e '.ts$' -e '.tsx$' <<< "$STAGED" || true)
JS_FULLY_STAGED=$(grep -e '.js$' -e '.ts$' -e '.tsx$' <<< "$FULLY_STAGED" || true)
SNAPSHOT_STAGED=$(grep .snap$ <<< "$STAGED" || true)
PRETTIER_STAGED=$(grep -E '.(md|css|scss|js|ts|tsx|json|yaml|yml|html)$' <<< "$STAGED" || true)
PRETTIER_FULLY_STAGED=$(grep -E '.(md|css|scss|js|ts|tsx|json|yaml|yml|html)$' <<< "$FULLY_STAGED" || true)

# Uncomment, and add more variables to the list, for debugging help.
# tr ' ' '\n' <<< "STAGED $STAGED PATCH_STAGED $PATCH_STAGED FULLY_STAGED $FULLY_STAGED JS_STAGED $JS_STAGED JS_FULLY_STAGED $JS_FULLY_STAGED SNAPSHOT_STAGED $SNAPSHOT_STAGED"
Expand Down
1 change: 1 addition & 0 deletions .githooks/pre-commit.5.prettier.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#!/usr/bin/env bash
# Format and re-stage fully staged files only.

Expand Down
9 changes: 0 additions & 9 deletions .githooks/pre-commit.9.build.sh

This file was deleted.

0 comments on commit fd0122d

Please sign in to comment.