forked from ModelEngine-Group/unified-cache-management
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformat.sh
More file actions
26 lines (22 loc) · 679 Bytes
/
format.sh
File metadata and controls
26 lines (22 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
check_command() {
if ! command -v "$1" &> /dev/null; then
echo "❓❓$1 is not installed, please run:"
echo "# Install lint deps"
echo "pip install -r requirements-lint.txt"
echo "# (optional) Enable git commit pre check"
echo "pre-commit install"
echo ""
echo "See step by step contribution guide:"
echo "Unifiedcache Official Website"
exit 1
fi
}
check_command pre-commit
# TODO: cleanup SC exclude
export SHELLCHECK_OPTS="--exclude=SC2046,SC2006,SC2086"
if [[ "$1" != 'ci' ]]; then
pre-commit run --all-files
else
pre-commit run --all-files --hook-stage manual
fi