Skip to content

Propose lint candidates derived from CodeRabbit review findings#263

Draft
leynos wants to merge 2 commits into
mainfrom
lint-candidates
Draft

Propose lint candidates derived from CodeRabbit review findings#263
leynos wants to merge 2 commits into
mainfrom
lint-candidates

Conversation

@leynos

@leynos leynos commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

This branch adds RFC 0001, which distils a corpus of 192 CodeRabbit review
findings (83 targeting Rust files) into seven candidate Whitaker lints that
are mechanically detectable, not covered by Clippy or rustc, and not already
scheduled in the roadmap. The RFC recommends three candidates for immediate
scheduling (test_helper_must_return_result, assertion_missing_message,
and no_std_env_operations), two as follow-ups (error_context_discarded
and no_drop_to_silence_unused), and defers two
(fallible_gap_before_guard and parameterizable_duplicate_tests) against
blocking roadmap infrastructure. Clusters already covered by rustc E0761,
clippy::missing_errors_doc, or scheduled roadmap work (§2.2, §7, §8) are
recorded as excluded so the corpus does not need re-analysis.

no_std_env_operations deliberately widens the original test-scoped
environment candidate: direct environment manipulation in tests is a symptom
of production code reading std::env ambiently, so the lint enforces the
injectable-handle pattern (for example &dyn mockable::Env) across
production and test code alike, using no_std_fs_operations as its
implementation template.

Review walkthrough

  • Start with
    docs/rfcs/0001-coderabbit-derived-lint-candidates.md
    for the full analysis: the exclusion screen against existing coverage, the
    cluster summary table, per-candidate detection sketches and configuration
    surfaces, and the tiered recommendation.
  • Then review
    docs/contents.md
    for the new "Requests for comments" index section linking the RFC.

Validation

  • make check-fmt: pass.
  • make test: 1453 passed, 3 skipped, 0 failed.
  • make typecheck: pass (cargo check --workspace --all-targets --all-features with -D warnings).
  • make lint: pass (cargo doc and cargo clippy with -D warnings).
  • make markdownlint: 69 files linted, 0 errors.
  • make nixie: all Mermaid diagrams validated successfully.

Notes

  • The source corpus lives outside the repository
    (~/docs/coderabbit-sample-findings.txt); the RFC records the cluster
    counts and severity profiles so the analysis is reproducible without it.
  • An earlier commit on this branch fixing a Mermaid parse error in the suite
    design document was dropped during rebase because the identical fix landed
    on main independently.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @leynos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7ab8ea31-7156-410e-8a74-269d0d9ad949

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lint-candidates

Comment @coderabbitai help to get the list of available commands.

codescene-access[bot]

This comment was marked as outdated.

Analyse a corpus of 192 CodeRabbit review findings (83 in Rust files)
and distil the recurring, mechanically detectable finding classes not
already scheduled in `docs/roadmap.md` into seven candidate lints.

Recommend three for immediate scheduling
(`test_helper_must_return_result`, `assertion_missing_message`, and
`no_direct_env_in_tests`), two as follow-ups
(`error_context_discarded` and `no_drop_to_silence_unused`), and defer
two (`fallible_gap_before_guard` pending the ownership-shape
infrastructure, `parameterizable_duplicate_tests` pending clone
detector and rstest hygiene experience).

Clusters already covered by rustc (E0761), Clippy
(`missing_errors_doc`), or scheduled roadmap work (§2.2, §7, §8) are
recorded as excluded so the corpus does not need re-analysis.

Link the RFC from `docs/contents.md` under a new "Requests for
comments" section.
@leynos leynos force-pushed the lint-candidates branch from 369716f to 51e208a Compare July 6, 2026 23:30
codescene-access[bot]

This comment was marked as outdated.

Rename the `no_direct_env_in_tests` candidate to
`no_std_env_operations` and widen its scope from test contexts to all
code. Direct environment manipulation in tests is a symptom of a
production-side design gap: code that reads `std::env` ambiently
forces its tests to mutate process-global state. The lint now targets
the mechanism everywhere, mirroring how `no_std_fs_operations` pushes
filesystem access behind injectable handles, with context-sensitive
remedies: inject an environment handle (for example
`&dyn mockable::Env`) in production code, and construct a stub such as
`MockEnv` in tests.

Split severity per operation (mutation deny-by-default, reads warn),
keep the sanctioned-boundary allowlist, and replace the guard-crate
open question with whether the help text should bless `mockable::Env`
by name.
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