Skip to content

ci: upgrade pyrefly to 1.1.1 and gate on a baseline file - #3080

Draft
terrykong wants to merge 1 commit into
mainfrom
typecheck/pyrefly-baseline
Draft

terrykong wants to merge 1 commit into
mainfrom
typecheck/pyrefly-baseline

Conversation

@terrykong

Copy link
Copy Markdown
Collaborator

What

Upgrade the pinned type checker pyrefly 0.24.2 → 1.1.1 and replace the hand-maintained per-file project-includes allow-list (plus the CI "zero errors not in whitelist" ratchet) with pyrefly 1.1's native baseline file.

The two are coupled: the stricter 1.1.1 engine (~92% typing-spec conformance vs ~70% for 0.24.2) reports new diagnostics on previously-clean files, which the baseline absorbs — so they land together.

Changes

  • pyproject.toml + uv.lock: pyrefly==1.1.1 (regenerated with uv lock).
  • pyrefly.toml: project-includes is now the full globs (nemo_rl/examples/docs/tools); the explicit allow-list is deleted.
  • pyrefly-baseline.json: snapshot of all existing errors (pyrefly check --update-baseline). Matched on (path, rule, column), so it's resilient to line drift.
  • pre-commit + CI now run pyrefly check --baseline pyrefly-baseline.json — failing only on new errors in any file (new or existing).

Why it's better than the allow-list

  • No more editing pyrefly.toml when a file becomes clean (the CI ratchet is gone).
  • Per-line gating: new code in an already-"dirty" file is now type-checked (the whole-file allow-list skipped those entirely).
  • Shrink the baseline over time with pyrefly check --update-baseline as errors are fixed.

No source (.py) changes.

🤖 Generated with Claude Code

Replace the hand-maintained per-file `project-includes` allow-list (and the CI
"zero errors not in whitelist" ratchet) with pyrefly 1.1's native baseline, and
bump the checker in the same change because the two are coupled: the stricter
1.1.1 engine (~92% typing-spec conformance vs ~70% for 0.24.2) reports new
diagnostics on previously-clean files, which the baseline absorbs.

- pyproject.toml + uv.lock: pyrefly 0.24.2 -> 1.1.1 (regenerated with `uv lock`).
- pyrefly.toml: project-includes is now the full globs (nemo_rl/examples/docs/
  tools); the explicit allow-list is deleted.
- pyrefly-baseline.json: snapshot of all 1261 existing errors
  (`pyrefly check --update-baseline`). Matched on (path, rule, column), so it is
  resilient to line drift.
- pre-commit + CI now run `pyrefly check --baseline pyrefly-baseline.json`,
  failing only on NEW errors in any file (new or existing). No more editing
  pyrefly.toml when a file becomes clean, and per-line gating means new code in
  an already-"dirty" file is type checked too.

Shrink the baseline over time with `pyrefly check --update-baseline` as errors
are fixed. No source (.py) changes.

Signed-off-by: Terry Kong <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the CI Relating to CI label Jul 6, 2026
@terrykong terrykong added the CI:L1 Run doctests, unit tests, and functional tests label Nov 5, 2026
RNabel added a commit that referenced this pull request Nov 19, 2026
Pin pyrefly 1.4.0 and replace the per-file allow-list in pyrefly.toml, and
the CI step that kept it complete, with pyrefly's baseline file. Every file
under nemo_rl, examples, docs and tools is now checked, and the check fails
only on errors that are not recorded in pyrefly-baseline.json.

The baseline holds the 1,610 errors that exist today. Five suppression
comments are renamed to the error codes 1.4.0 uses. This revives the
approach of #3080 on current main.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: Robin Nabel <[email protected]>
@terrykong terrykong removed the CI Relating to CI label Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L1 Run doctests, unit tests, and functional tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant