Pyright Report Validator (scripts/check_pyright_report.py)

prefect · scripts/check_pyright_report.py · python · Apache-2.0
testing, infra, dev-tools, lang:python

Parses and validates Pyright JSON output to ensure CI checks are actually running. Use this in CI/CD pipelines to prevent silent failures caused by misconfigured static analysis.

# Source: https://github.com/PrefectHQ/prefect | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""
Report on a pyright JSON report and fail if the run was not a clean, real run.

Pyright exits 0 when its configuration matches no files at all, so a
misconfigured `include` silently turns the CI check into a no-op. Running with
`--outputjson` and checking the summary here catches that case.

Usage: python scripts/check_pyright_report.py <report.json> [--pyright-status N]
"""

import argparse
import json
import sys
from typing import Any

# pyright exits 0 with no diagnostics and 1 when it reports diagnostics; anything
# higher is a pyright failure, e.g. a config file that cannot be pa

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key