Meta: Dont try to lint files that are being deleted
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ fi
|
|||||||
subDir="$(dirname -- "$0")"
|
subDir="$(dirname -- "$0")"
|
||||||
|
|
||||||
# Get all files staged for commit
|
# Get all files staged for commit
|
||||||
files="$(git --no-pager diff --cached --name-only)"
|
files="$(git --no-pager diff --cached --name-only --diff-filter=d)"
|
||||||
|
|
||||||
failures=0
|
failures=0
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ else
|
|||||||
Either skip this script, or install clang-format-11."
|
Either skip this script, or install clang-format-11."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
files="${1:-$(git --no-pager diff --cached --name-only)}"
|
files="${1:-$(git --no-pager diff --cached --name-only --diff-filter=d)}"
|
||||||
files="$(echo "$files" | grep -E '\.(cpp|h)$')"
|
files="$(echo "$files" | grep -E '\.(cpp|h)$')"
|
||||||
|
|
||||||
if [ -z "$files" ]; then
|
if [ -z "$files" ]; then
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ if ! command -v shellcheck > /dev/null 2>&1; then
|
|||||||
Either skip this script, or install shellcheck."
|
Either skip this script, or install shellcheck."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
files="${1:-$(git --no-pager diff --cached --name-only)}"
|
files="${1:-$(git --no-pager diff --cached --name-only --diff-filter=d)}"
|
||||||
files="$(echo "$files" | grep -E '\.sh$')"
|
files="$(echo "$files" | grep -E '\.sh$')"
|
||||||
|
|
||||||
if [ -z "$files" ]; then
|
if [ -z "$files" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user