mirror of
https://github.com/langgenius/dify.git
synced 2026-05-26 04:00:39 -04:00
chore: Remove pyright in favor of pyrefly (#36154)
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
||||
cd "$SCRIPT_DIR/.."
|
||||
|
||||
# Get the path argument if provided
|
||||
PATH_TO_CHECK="$1"
|
||||
|
||||
# Determine CPU core count based on OS
|
||||
CPU_CORES=$(
|
||||
if [[ "$(uname -s)" == "Darwin" ]]; then
|
||||
sysctl -n hw.ncpu 2>/dev/null
|
||||
else
|
||||
nproc
|
||||
fi
|
||||
)
|
||||
|
||||
# Run basedpyright checks
|
||||
uv run --directory api --dev -- basedpyright --threads "$CPU_CORES" $PATH_TO_CHECK
|
||||
@@ -8,6 +8,15 @@ cd "$REPO_ROOT"
|
||||
|
||||
EXCLUDES_FILE="api/pyrefly-local-excludes.txt"
|
||||
|
||||
target_paths=()
|
||||
for target_path in "$@"; do
|
||||
if [[ "$target_path" == api/* ]]; then
|
||||
target_paths+=("${target_path#api/}")
|
||||
else
|
||||
target_paths+=("$target_path")
|
||||
fi
|
||||
done
|
||||
|
||||
pyrefly_args=(
|
||||
"--summary=none"
|
||||
"--use-ignore-files=false"
|
||||
@@ -26,7 +35,7 @@ fi
|
||||
|
||||
tmp_output="$(mktemp)"
|
||||
set +e
|
||||
uv run --directory api --dev pyrefly check "${pyrefly_args[@]}" >"$tmp_output" 2>&1
|
||||
uv run --directory api --dev pyrefly check "${pyrefly_args[@]}" "${target_paths[@]}" >"$tmp_output" 2>&1
|
||||
pyrefly_status=$?
|
||||
set -e
|
||||
|
||||
|
||||
@@ -17,5 +17,5 @@ uv run --directory api --dev ruff format ./
|
||||
# run dotenv-linter linter
|
||||
uv run --project api --dev dotenv-linter ./api/.env.example ./web/.env.example
|
||||
|
||||
# run basedpyright check
|
||||
dev/basedpyright-check
|
||||
# run pyrefly check
|
||||
dev/pyrefly-check-local
|
||||
|
||||
Reference in New Issue
Block a user