Skip to content

chore(typing): remove the 14 bare type: ignore comments - #822

Merged
petercorke merged 2 commits into
mainfrom
chore/typing-ignore-codes
Oct 17, 2026
Merged

petercorke merged 2 commits into
mainfrom
chore/typing-ignore-codes

Conversation

@petercorke

Copy link
Copy Markdown
Owner

The typing pass's definition of done said no # type: ignore without an error code. There were 14. Now there are none without a code, and 14 fewer in total (89 to 75).

  • models/DH/TwoLink.py (7) and ets/ETS2.py (1, on a commented-out line): these never did anything. mypy only honours # type: ignore when it is the whole comment, and these followed other comment text. Removed.
  • Link.I setter: converts the argument with np.asarray instead of ignoring that ArrayLike has no .T or .reshape. A list or nested list is now accepted as the inertia; it used to be rejected as an invalid shape.
  • Link.closest_point and Link.iscollided: a link not attached to a robot gave 'NoneType' object has no attribute '_update_link_tf'. It now raises ValueError saying to use skip=True.
  • BaseRobot segment recursion iterates a local link.children or [], the same as nchildren, instead of indexing an Optional list.

Two new tests (list inertia, robotless link); both fail on the old code. mypy is clean and the suite is unchanged (the same 29 failures that already exist locally, 2 more passing).

🤖 Generated with Claude Code

Every "type: ignore" now has an error code, or is gone.

- models/DH/TwoLink.py (7) and ets/ETS2.py (1, on a commented-out line): the
  comments never did anything.  mypy only honours "type: ignore" when it is the
  whole comment, and these followed other comment text.  Removed.
- Link.I setter: convert the argument with np.asarray first, instead of
  ignoring that ArrayLike has no .T or .reshape.  A list, or a nested list,
  is now accepted as the inertia; it was rejected as an invalid shape.
- Link.closest_point and Link.iscollided: a link that does not belong to a
  robot gave "'NoneType' object has no attribute '_update_link_tf'"; it now
  raises ValueError saying to use skip=True.
- BaseRobot's segment recursion iterates a local "link.children or []", the same
  as nchildren, instead of indexing an Optional list.

Tests for the list inertia and the robotless link.  mypy is clean and the suite
is unchanged (the same 29 failures that already exist locally).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke
petercorke enabled auto-merge (squash) October 17, 2026 02:20
@petercorke
petercorke merged commit 4aeefdb into main Oct 17, 2026
23 checks passed
@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (2881ee1) to head (098a1d6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/roboticstoolbox/robot/Link.py 0.00% 11 Missing ⚠️
src/roboticstoolbox/models/DH/TwoLink.py 0.00% 7 Missing ⚠️
src/roboticstoolbox/robot/BaseRobot.py 0.00% 6 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #822   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        144     144           
  Lines      14930   14938    +8     
=====================================
- Misses     14930   14938    +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant