Skip to content

Commit e28433e

Browse files
authored
[Maint] Update uncommitted change detection command in format.sh (#1102)
* [Maint] Remove pre-commit install in `format.sh` * [Maint] Update uncommitted change detection command * [Minor] update warning messages
1 parent 8a5eb56 commit e28433e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

format.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ ALL_FILES=''
2929
ONLY_CHANGED=''
3030
FILES=()
3131
if (($# == 0)); then
32-
if [[ -n "$(git status --porcelain)" ]]; then
33-
echo 'Detected uncommitted changes. Please commit or stash them before running format.sh.' >&2
32+
if [[ -n "$(git status --porcelain --ignore-submodules --untracked-files=no)" ]]; then
33+
echo "Detected uncommitted changes. Please commit or stash them before running $0." >&2
3434
exit 1
3535
fi
3636
ONLY_CHANGED='true'
3737
else
3838
while (($# > 0)); do
39-
case $1 in
39+
case "$1" in
4040
--files)
4141
shift
4242
while (($# > 0)); do
@@ -88,11 +88,6 @@ if ! python3 -m pre_commit --version &>/dev/null; then
8888
python3 -m pip install pre-commit
8989
fi
9090

91-
if [[ ! -f "${ROOT}/.git/hooks/pre-commit" ]]; then
92-
echo "Installing and initializing pre-commit hooks..."
93-
python3 -m pre_commit install --install-hooks
94-
fi
95-
9691
echo 'tile-lang pre-commit: Check Start'
9792

9893
if [[ -n "${ALL_FILES}" ]]; then

0 commit comments

Comments
 (0)