Repository navigation
fix(rules): flag only deliberate TODO markers, skip eprintln and invariant expect - #698
Merged
Merged
Conversation
ajianaz
force-pushed
the
fix/681-682-rule-false-positives
branch
from
October 27, 2026 05:47
15837b0 to
152969d
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
bug-todo: only an upper-caseTODO,FIXME,HACKorXXXwhole word inside a comment.pub mod todo;,todo_stateand prose like "the todo list" are no longer flagged.bug-println: no longer matcheseprintln!/eprint!;println!,print!anddbg!are still flagged.bug-expect: flags only.expect(""); a non-empty message states an invariant.bug-unwrapstill covers bareunwrap().Why
22 of 22
bug-todohits and all librarybug-printlnhits 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
expectwith and without a message.