Skip to content

fix(rules): flag only deliberate TODO markers, skip eprintln and invariant expect - #698

Merged
ajianaz merged 1 commit into
developfrom
fix/681-682-rule-false-positives
Oct 27, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/681-682-rule-false-positives

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

What

  • bug-todo: only an upper-case TODO, FIXME, HACK or XXX whole word inside a comment. pub mod todo;, todo_state and prose like "the todo list" are no longer flagged.
  • bug-println: no longer matches eprintln! / eprint!; println!, print! and dbg! are still flagged.
  • bug-expect: flags only .expect(""); a non-empty message states an invariant. bug-unwrap still covers bare unwrap().

Why

22 of 22 bug-todo hits and all library bug-println hits on a real workspace were false positives (#681, #682). Closes #681. Refs #682: treating the modules of a binary crate as program code is not done here and stays open.

Testing

  • Regression tests for the issue repros: identifier, module name, prose, lower-case, and the real markers; stdout vs stderr macros; expect with and without a message.
  • fmt, clippy -D warnings and the full suite pass.

…riant expect (#681, #682)

Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
@ajianaz
ajianaz force-pushed the fix/681-682-rule-false-positives branch from 15837b0 to 152969d Compare October 27, 2026 05:47
@ajianaz
ajianaz merged commit 3fb5a7c into develop Oct 27, 2026
13 checks passed
ajianaz added a commit that referenced this pull request Oct 27, 2026
…riant expect (#698)

## What

- `bug-todo`: only an upper-case `TODO`, `FIXME`, `HACK` or `XXX` whole
word inside a comment. `pub mod todo;`, `todo_state` and prose like "the
todo list" are no longer flagged.
- `bug-println`: no longer matches `eprintln!` / `eprint!`; `println!`,
`print!` and `dbg!` are still flagged.
- `bug-expect`: flags only `.expect("")`; a non-empty message states an
invariant. `bug-unwrap` still covers bare `unwrap()`.

## Why

22 of 22 `bug-todo` hits and all library `bug-println` hits on a real
workspace were false positives (#681, #682). Closes #681. Refs #682:
treating the modules of a binary crate as program code is not done here
and stays open.

## Testing

- Regression tests for the issue repros: identifier, module name, prose,
lower-case, and the real markers; stdout vs stderr macros; `expect` with
and without a message.
- fmt, clippy -D warnings and the full suite pass.

Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
Co-authored-by: ajianaz <ajianaz@users.noreply.github.com>
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.

fix(rules): bug-todo matches the word "todo" in identifiers, module names and prose (22 of 22 hits were false positives)

1 participant