Add pyrefly type checking: pyrefly.toml config, CI integration#5458
Add pyrefly type checking: pyrefly.toml config, CI integration#5458vfdev-5 wants to merge 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
| inputs, kernel, bias = self.promote_dtype( | ||
| inputs, kernel, bias, dtype=self.dtype | ||
| ) | ||
| assert inputs is not None and kernel is not None |
There was a problem hiding this comment.
This prevents pyrefly ignore comment on the code below:
out = dot_general(
inputs, # pyrefly: ignore [bad-argument-type]
kernel, # pyrefly: ignore [bad-argument-type]
((axis, contract_ind), (batch_dims, batch_ind)),
precision=self.precision,
)and pyrefly is right on as self.promote_dtype output type hint is Array | None, so they deduce that inputs and kernel can be also None.
| @@ -0,0 +1,26 @@ | |||
| # Pyrefly configuration - migrated from mypy | |||
| # Only type-check flax/linen/linear.py for now; expand as issues are resolved. | |||
| project-includes = ["flax/linen/linear.py"] | |||
There was a problem hiding this comment.
Right now the check runs over single file to show that there is no more errors like # pyrefly: ignore [bad-class-definition] (as in previous attempt: https://github.com/google/flax/pull/5437/changes#diff-cfcdd6089c08daca13a27f79e07b856585c5f9b6910570f9cc3e7be76fd746b1R103)
7fd161d to
9da768e
Compare
!!! PR based on #5460
Agent-Logs-Url: https://github.com/vfdev-5/flax/sessions/d862656c-0c03-46b4-971e-55ff771b19b9