Commit 588c3d1
committed
fix(types): clear ty-check diagnostics on main paths
Three residual ``ty check`` diagnostics (pre-existing — not
introduced by this branch, but worth clearing now that the workflow
actually runs on a useful file set):
- ``adidt/xsa/builders/adrv9009.py:680`` — ``render_dt(cs=trx2_cs)``
had ``trx2_cs: int | None`` at the call site. The caller is
inside ``if is_fmcomms8:`` where ``trx2_cs`` is always an int,
so narrow with an explicit ``assert is not None`` — documents
the invariant the surrounding code already relies on.
- ``adidt/xsa/builders/fmcdaq2.py:197`` — the AD9523 channel specs
were a list of dicts with mixed ``int | str`` values, so
``_m1 // s["divider"]`` was ``int // (int | str)``. Replace with
a list of typed 3-tuples ``(id: int, name: str, divider: int)``
and unpack at iteration. Same runtime behaviour, cleaner type.
- ``adidt/devices/fpga_ip/adxcvr.py:62`` — the ``use_div40`` branch
only guarded ``self.jesd_l is not None`` but also dereferenced
``self.jesd_m`` and ``self.jesd_s`` (both ``int | None``).
Widen the guard to narrow all three. Fixes two of the three
lines emitting ``adi,jesd-{l,m,s}``.
Also update the ``Type Check (ty)`` workflow to target the actual
typed surface: drop the stale ``adidt/boards/`` path (directory was
removed during the re-arch) and add ``adidt/devices/``,
``adidt/system.py``, ``adidt/tools/``. ``ty check`` now finishes
with "All checks passed!" on the main paths.1 parent 1f8faea commit 588c3d1
4 files changed
Lines changed: 32 additions & 17 deletions
File tree
- .github/workflows
- adidt
- devices/fpga_ip
- xsa/builders
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
669 | 674 | | |
670 | 675 | | |
671 | 676 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
191 | 196 | | |
192 | 197 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
198 | 203 | | |
199 | | - | |
| 204 | + | |
200 | 205 | | |
201 | 206 | | |
202 | 207 | | |
| |||
0 commit comments