Skip to content

fix: remove stale dead code allowances - #467

Merged
lxsaah merged 3 commits into
aimdb-dev:mainfrom
Wizard52007:fix/stale-dead-code-allows
Nov 11, 2026
Merged

lxsaah merged 3 commits into
aimdb-dev:mainfrom
Wizard52007:fix/stale-dead-code-allows

Conversation

@Wizard52007

Copy link
Copy Markdown
Contributor

Summary

Addresses #462 by removing stale and overly broad dead_code allowances and replacing them with more targeted lint handling.

Changes

  • Removed the unnecessary dead_code allowance from aimdb-mcp's set_state.
  • Removed blanket dead_code allowances from the CLI error enum and implementation.
  • Added targeted allowances for intentionally unused future error variants.
  • Moved test-only CLI error helpers into a #[cfg(test)] implementation.
  • Replaced the Zenoh profile's broad dead_code and unused_imports suppression with a conditional allowance for no-std builds.
  • Restricted test-only methods to test builds.
  • Added targeted allowances for supported QoS variants that are not currently constructed in production code.

Validation

  • make check
  • cargo test -p aimdb-zenoh-connector
  • cargo test -p aimdb-zenoh-connector --features std
  • cargo test -p aimdb-cli
  • cargo test -p aimdb-mcp
  • git diff --check

All checks passed.

AI Assistance Disclosure

This contribution was developed using an AI-assisted workflow with Antigravity. I reviewed the implementation, examined the resulting diff, investigated the conditional compilation and lint decisions, and ran the validation checks before submitting this PR.

@Wizard52007
Wizard52007 requested a review from lxsaah as a code owner November 11, 2026 03:32

@lxsaah lxsaah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your first contribution to AimDB! The CLI and MCP changes look good. Could you scope the dead_code allowance in the Zenoh profile to the items that need it in no_std builds? That way, embedded builds still flag newly unused code elsewhere in the module.


// Used by the ROS 2 connector, which builds on this module.
#![allow(dead_code, unused_imports)]
#![cfg_attr(not(feature = "std"), allow(dead_code))]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we scope the no_std dead_code allowance to the items that need it? The module-wide attribute still hides newly unused code in embedded builds.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

okey working on it !!

Signed-off-by: Wizard52007 <iamsanketspatil@gmail.com>
@Wizard52007

Copy link
Copy Markdown
Contributor Author

Thanks for pointing this out! I've removed the module-level dead_code allowance and scoped it to the 25 individual items that need it in no_std builds.

Both no_std and std configurations pass, along with the connector tests and full make check.

@Wizard52007

Copy link
Copy Markdown
Contributor Author

Hi! I've addressed your feedback by removing the module-level dead_code allowance from the Zenoh profile and scoping the allowances to the individual items that require them in no_std builds.

I've also validated both default and std builds, tests, formatting, and make check locally.

The latest commit is b86bef4. I pushed an additional empty commit (ab043ee) to retrigger CI, but GitHub is currently awaiting maintainer approval to run the workflows.

Could you please approve the pending CI runs and take another look at the updated changes when convenient?

Thanks for your time and review!

@lxsaah

lxsaah commented Nov 11, 2026

Copy link
Copy Markdown
Member

Sure, I already reviewed the changes. Everything looks fine, but there were some issues with workflow runs ( not related to your changes)

I will approve and merge after checking those.

@Wizard52007

Copy link
Copy Markdown
Contributor Author

Okey, that sounds good !

@Wizard52007
Wizard52007 requested a review from lxsaah November 11, 2026 17:52
@Wizard52007

Copy link
Copy Markdown
Contributor Author

All the checks have successfully passed, any update on merge after that ?

@lxsaah lxsaah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lgtm!

@lxsaah
lxsaah merged commit a84157a into aimdb-dev:main Nov 11, 2026
10 checks passed
@lxsaah

lxsaah commented Nov 11, 2026

Copy link
Copy Markdown
Member

All the checks have successfully passed, any update on merge after that ?

All done! Thanks a lot! Feel free to tackle another one!!

@Wizard52007

Copy link
Copy Markdown
Contributor Author

Thankss !! keep up the good work and all the best for further challenges...

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.

2 participants