pudl.scripts.pyrefly_status#
Report on the current status of pyrefly typing in the repo.
Meant for the weekly baseline-ratcheting workflow: pick the module or error kind
with the biggest count, fix it, then shrink .pyrefly-baseline.json.
Attributes#
Functions#
|
Run a pyrefly subcommand and return its JSON stdout, parsed. |
|
Run pyrefly directly and return its full, per-occurrence error list. |
|
Run |
|
|
|
Display a coverage report path relative to the repo root when possible. |
|
|
|
Report on the current status of pyrefly typing in the repo. |
|
Summarize remaining pyrefly type errors by module and/or error kind. |
|
Summarize pyrefly coverage report's per-module type coverage as a table. |
Module Contents#
- pudl.scripts.pyrefly_status._run_pyrefly(args: list[str]) dict[source]#
Run a pyrefly subcommand and return its JSON stdout, parsed.
Raises
click.ClickExceptionif pyrefly can’t be invoked or produces unparsable output.
- pudl.scripts.pyrefly_status._collect_live_errors() list[dict][source]#
Run pyrefly directly and return its full, per-occurrence error list.
- pudl.scripts.pyrefly_status._collect_coverage_report() dict[source]#
Run
pyrefly coverage reportonsrc/and return its parsed JSON.Restricted to
src/since test modules aren’t expected to be fully typed. The returned dict hasmodule_reports(a list, one entry per module) andsummary(aggregate counts and coverage across all ofsrc/).
- pudl.scripts.pyrefly_status._print_counts(errors: list[dict], key: str, header: str, top: int | None) None[source]#
- pudl.scripts.pyrefly_status._relative_path(path: str) str[source]#
Display a coverage report path relative to the repo root when possible.
- pudl.scripts.pyrefly_status._COVERAGE_COLUMNS = ['typable', 'typed', 'any', 'untyped', 'coverage'][source]#
- pudl.scripts.pyrefly_status._print_coverage_table(report: dict, sort_by: str, top: int | None) None[source]#
- pudl.scripts.pyrefly_status.main() None[source]#
Report on the current status of pyrefly typing in the repo.
Meant for the weekly baseline-ratcheting workflow: pick the module or error kind with the biggest count, fix it, then shrink .pyrefly-baseline.json.