Skip to content

Commit

Permalink
Merge branch 'main' into @tjzel/worklets/native-worklets-module-stub
Browse files Browse the repository at this point in the history
  • Loading branch information
tjzel committed Sep 30, 2024
2 parents d5f6ad1 + 4a950dc commit 9b9731c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ print() {
echo " [PRECOMMIT]: $1" >&2
}

# `lint-staged` is great, but its' parsing capabilites of more advanced CLIs is poor.
BRANCH=$(git symbolic-ref HEAD)
if [ "$BRANCH" = "refs/heads/main" ]; then
print "You tried to commit to main, which is probably a mistake. Aborting commit."
exit 1
fi

# `lint-staged` is great, but its' parsing capabilities of more advanced CLIs is poor.
# We can use it reliably only with programs that expect the following syntax:
# command [options] [arg1] [arg2] [arg3] ...
# more sophisiticated checks should be done in this script without `lint-staged`.
# more sophisticated checks should be done in this script without `lint-staged`.
print 'Running "lint-staged" ...'
yarn lint-staged

Expand Down Expand Up @@ -51,9 +57,9 @@ if echo "$STAGED_FILES" | grep -E "$PLUGIN_PATH" >/dev/null; then
PLUGIN_OUTPUT_PATH="$PLUGIN_PATH/index.js"
if git status -u | grep -E "$PLUGIN_OUTPUT_PATH" --silent; then
git add "$PLUGIN_PATH"
print "Non-commited changes were automatically added to the commit."
print "Non-committed changes were automatically added to the commit."
else
print "All Babel plugin files were already commited."
print "All Babel plugin files were already committed."
fi
else
print "No changes. Skipping plugin checks."
Expand Down
11 changes: 11 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

print() {
echo " [PREPUSH]: $1" >&2
}

BRANCH=$(git symbolic-ref HEAD)
if [ "$BRANCH" = "refs/heads/main" ]; then
print "You tried to push to main, which is probably a mistake. Aborting push."
exit 1
fi
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable no-var */
'use strict';

// This file works by accident - currently Builder Bob doesn't move `.d.ts` files to output types.
// If it ever breaks, we should address it so we'd not pollute the user's global namespace.

import type {
StyleProps,
MeasuredDimensions,
Expand Down

0 comments on commit 9b9731c

Please sign in to comment.