Skip to content

Commit

Permalink
SFT-1928: added rule to prevent commits to main and dev-v* in pre-commit
Browse files Browse the repository at this point in the history
hook
  • Loading branch information
mjg-foundation committed Apr 20, 2023
1 parent e653707 commit ba3ff5c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# SPDX-FileCopyrightText: 2021 Foundation Devices, Inc. <hello@foundationdevices.com>
# SPDX-License-Identifier: GPL-3.0-or-later

branch=`git symbolic-ref HEAD`
if [ "$branch" = "refs/heads/main" ] || [[ "$branch" == refs/heads/dev-v* ]]; then
echo "Direct commits to the main and dev branches are not allowed."
exit 1
fi

RESULTS=$(find . -name '*.py' -exec grep -H fake_it[\ ]*=[\ ]*True {} +)
LEN=`expr length "$RESULTS"`
echo $RESULTS
Expand Down

0 comments on commit ba3ff5c

Please sign in to comment.