Skip to content

chore: enable safety rules and stricter type-ignore validation - #798

Merged
kstonekuan merged 5 commits into
Hebbian-Robotics:mainfrom
harshaadimulam22-creator:chore/safety-rules-and-ignore-validation
Nov 18, 2026
Merged

kstonekuan merged 5 commits into
Hebbian-Robotics:mainfrom
harshaadimulam22-creator:chore/safety-rules-and-ignore-validation

Conversation

@harshaadimulam22-creator

@harshaadimulam22-creator harshaadimulam22-creator commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #789.

Enable the requested Ruff safety rules and reject malformed or unknown ty suppression comments in the root project and all three workspace examples. Fix the four resulting redundant lambda wrappers in the MediaPipe test doubles.

Why

The existing CI quality gate can enforce these checks with the locked tools. The Ruff selection now includes PLE, LOG, PGH003, PGH004, PLW0108, PLC3002 and the seven requested async rules (ASYNC210, ASYNC220, ASYNC221, ASYNC222, ASYNC230, ASYNC250, ASYNC251).

The test changes pass SimpleNamespace or object directly instead of wrapping the same call in a lambda. Existing outcome tests still check sampled detector timestamps and the resulting hand-absence interval. No new tests of lint configuration or third-party behavior were added.

Python 3.11 support, the five-day dependency-age guard, existing style exceptions and uv.lock are unchanged. There is no production or stored-data behavior change.

Validation

Tested on macOS with Python 3.13.9, locked Ruff 0.17.2 and ty 0.0.91.

Root commands:

uv sync --locked
uv run --locked ruff check --fix
uv run --locked ruff format
uv run --locked ty check
PATH="$PWD/.venv/bin:/tmp/darwin_arm64:$PATH" HFLOW_FFMPEG=/tmp/darwin_arm64/ffmpeg .venv/bin/python -m pytest -q -n 4
git diff --check

Ruff, formatting, ty and whitespace checks passed. The root suite finished with 2599 passed, 47 skipped.

Each changed workspace example was synced into its own locked environment and checked with:

uv run --locked --project examples/<example> ruff check --fix examples/<example>
uv run --locked --project examples/<example> ruff format examples/<example>
uv run --locked --project examples/<example> ty check --project examples/<example> --extra-search-path . examples/<example>
uv run --locked --project examples/<example> pytest -q examples/<example>/tests
Example Ruff / formatting ty Colocated tests
build_ai_evaluation Passed Passed 45 passed
egosuite_evaluation Passed Passed 63 passed
build_ai_autoresearch Passed Passed with its training extra installed 21 passed

For the autoresearch type check, the same locked commands included --extra training; its pytest result above used the base development environment.

The Python-version matrix and opt-in network, Docker, bucket and model suites were not run.

Checklist

  • Preserved existing outcome coverage; production behavior is unchanged.
  • No documentation update needed for this quality-gate-only change.
  • Ran the required Ruff and ty checks in the root and all changed workspace examples.
  • Ran the root and example pytest suites.
  • No recordings, generated media, credentials, private URLs or runtime artifacts are included.
  • Stored-data compatibility is unchanged.

AI assistance

Codex assisted with the configuration changes, test-double cleanup and local validation.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

Copy link
Copy Markdown

👋 Hi @harshaadimulam22-creator — thank you so much for your first contribution to HFlow!

A maintainer will review your pull request as soon as possible. In the meantime:

💡 Tip: one open pull request per contributor at a time. Before starting an issue, check its sidebar for an assignee or a linked pull request. Either one means somebody is already on it; everything else is fair game.

We are excited to have you here and appreciate your help making the project better! 🙌

@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This PR appears safe to merge.

Summary

This PR strengthens Ruff and ty checks in the root project and three workspace examples without changing production behavior.

  • Ruff and ty now catch more code and suppression-comment issues.

No actionable issues found.

Reviews (1) · Last reviewed commit: "chore: validate autoresearch type-ignore..." · Reviewed by Greptile

@harshaadimulam22-creator

Copy link
Copy Markdown
Contributor Author

Hi maintainers, could you please review this PR when you have a chance? All CI checks are passing. This contribution is part of a course assignment due today, so I would appreciate a review or feedback if your schedule allows. I understand that review may take longer. Thank you for your time.

@harshaadimulam22-creator

Copy link
Copy Markdown
Contributor Author

Hi maintainers!

My PR #798 has one approving review from Greptile, all 5 checks have passed, and GitHub reports no merge conflicts. However, merging is still blocked on my side.

Could you please clarify whether human maintainer approval or any additional repository permission is required?

This contribution is part of my course assignment, so I would really appreciate your guidance.

Thank you!

@kstonekuan kstonekuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for this!

@kstonekuan
kstonekuan merged commit 3aacb69 into Hebbian-Robotics:main Nov 18, 2026
5 checks passed
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.

Enable Ruff safety rules and stricter type-ignore validation

2 participants