mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
14 lines
359 B
Bash
Executable File
14 lines
359 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
# We check only our code, that's why we skip contrib
|
|
GIT_ROOT=$(git rev-parse --show-cdup)
|
|
GIT_ROOT=${GIT_ROOT:-.}
|
|
tmp=$(mktemp)
|
|
if ! find "$GIT_ROOT" -name '*.py' -not -path "$GIT_ROOT/contrib/*" -exec black --check --diff {} + 1>"$tmp" 2>&1; then
|
|
# Show the result only if some files need formatting
|
|
cat "$tmp"
|
|
fi
|
|
rm "$tmp"
|