mirror of
https://github.com/langgenius/dify.git
synced 2026-03-07 16:45:58 +08:00
35 lines
767 B
Bash
Executable File
35 lines
767 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
|
REPO_ROOT="$SCRIPT_DIR/.."
|
|
cd "$REPO_ROOT"
|
|
|
|
EXCLUDES_FILE="api/pyrefly-local-excludes.txt"
|
|
|
|
pyrefly_args=(
|
|
"--summary=none"
|
|
"--project-excludes=.venv"
|
|
"--project-excludes=migrations/"
|
|
"--project-excludes=tests/"
|
|
)
|
|
|
|
if [[ -f "$EXCLUDES_FILE" ]]; then
|
|
while IFS= read -r exclude; do
|
|
[[ -z "$exclude" || "${exclude:0:1}" == "#" ]] && continue
|
|
pyrefly_args+=("--project-excludes=$exclude")
|
|
done < "$EXCLUDES_FILE"
|
|
fi
|
|
|
|
tmp_output="$(mktemp)"
|
|
set +e
|
|
uv run --directory api --dev pyrefly check "${pyrefly_args[@]}" >"$tmp_output" 2>&1
|
|
pyrefly_status=$?
|
|
set -e
|
|
|
|
uv run --directory api python libs/pyrefly_diagnostics.py < "$tmp_output"
|
|
rm -f "$tmp_output"
|
|
|
|
exit "$pyrefly_status"
|