Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

ci: emit pyrefly diagnostics as GitHub workflow commands (#37974)

ojasarora.etha246dc8b17bc
diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml
index 623703c6d35..1cc46205d14 100644
--- a/.github/workflows/style.yml
+++ b/.github/workflows/style.yml
@@ -53,6 +53,8 @@ jobs:
- name: Run Type Checks
if: steps.changed-files.outputs.any_changed == 'true'
+ env:
+ PYREFLY_OUTPUT_FORMAT: github
run: make type-check-core
- name: Dotenv check
diff --git a/dev/pyrefly-check-local b/dev/pyrefly-check-local
index 01c58f7ad68..4b975792701 100755
--- a/dev/pyrefly-check-local
+++ b/dev/pyrefly-check-local
@@ -28,6 +28,10 @@ pyrefly_args=(
"--project-excludes=tests/"
)
+if [[ "${PYREFLY_OUTPUT_FORMAT:-}" == "github" ]]; then
+ pyrefly_args+=("--output-format=github")
+fi
+
if [[ -f "$EXCLUDES_FILE" ]]; then
while IFS= read -r exclude; do
[[ -z "$exclude" || "${exclude:0:1}" == "#" ]] && continue
@@ -36,6 +40,14 @@ if [[ -f "$EXCLUDES_FILE" ]]; then
fi
run_pyrefly() {
+ if [[ "${PYREFLY_OUTPUT_FORMAT:-}" == "github" ]]; then
+ set +e
+ "$@"
+ local pyrefly_status=$?
+ set -e
+ return "$pyrefly_status"
+ fi
+
local tmp_output
tmp_output="$(mktemp)"
@@ -62,11 +74,17 @@ fi
run_pyrefly "${pyrefly_command[@]}" || status=$?
if (( ${#target_paths[@]} == 0 )); then
+ test_containers_args=(
+ "--summary=none"
+ "--use-ignore-files=false"
+ "--config=$TEST_CONTAINERS_CONFIG"
+ )
+ if [[ "${PYREFLY_OUTPUT_FORMAT:-}" == "github" ]]; then
+ test_containers_args+=("--output-format=github")
+ fi
run_pyrefly \
uv run --directory api --dev pyrefly check \
- "--summary=none" \
- "--use-ignore-files=false" \
- "--config=$TEST_CONTAINERS_CONFIG" \
+ "${test_containers_args[@]}" \
|| status=$?
fi