Skip to content

Create rstest helper fixture lint crate (8.2.1)#231

Draft
leynos wants to merge 7 commits into
mainfrom
8-2-1-create-the-rstest-helper-lint-crate
Draft

Create rstest helper fixture lint crate (8.2.1)#231
leynos wants to merge 7 commits into
mainfrom
8-2-1-create-the-rstest-helper-lint-crate

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented May 18, 2026

Summary

This branch implements roadmap task (8.2.1) by adding the experimental rstest_helper_should_be_fixture Dylint crate and registering RSTEST_HELPER_SHOULD_BE_FIXTURE without yet implementing call-site diagnostics.

ExecPlan: docs/execplans/8-2-1-create-the-rstest-helper-lint-crate.md

What changed

  • Added crates/rstest_helper_should_be_fixture with configuration defaults and unit coverage for TOML loading, normalization, provider attributes, and detection options.
  • Wired the lint into installer experimental resolution and the suite feature experimental-rstest-helper-should-be-fixture.
  • Enforced --experimental for explicit experimental lint builds such as --lint rstest_helper_should_be_fixture.
  • Resolved still-valid inline review comments for stub module docs, users-guide coverage, design-document ordering, and dynamic experimental feature expectations.
  • Updated user, developer, design, roadmap, and ExecPlan documentation for the experimental bootstrap behaviour.

Validation

  • cargo check -p rstest_helper_should_be_fixture --all-targets --all-features: passed
  • cargo check -p whitaker_suite --all-targets --all-features: passed
  • cargo nextest run -p rstest_helper_should_be_fixture --all-targets --all-features: passed, 9 tests
  • cargo nextest run -p whitaker_suite -p whitaker-installer --all-targets --all-features: passed, 527 tests
  • cargo nextest run -p whitaker-installer --all-targets --all-features -E 'binary(behaviour_core)': passed, 12 tests
  • cargo nextest run -p whitaker-installer --all-targets --all-features --profile ci -E 'test(scenario_dry_run_rejects_experimental_lint_without_opt_in)': passed, 1 test
  • cargo nextest run -p rstest_helper_should_be_fixture -p whitaker-installer --all-targets --all-features builder::tests::features_for_crate_handles_suite_experimental_mode: passed, 1 test
  • make check-fmt: passed
  • make markdownlint: passed with 0 errors
  • make lint: passed
  • make test: passed, 1431 tests passed and 2 skipped under the default nextest profile

Review notes

CodeRabbit was run after the crate/bootstrap milestone and again before final validation. Reported concerns were fixed: threshold normalization now preserves repeated-call semantics by clamping to at least 2, provider defaults no longer allocate a whole default config for fallback, and the private Config boundary is documented. CodeRabbit also reviewed the explicit experimental lint opt-in fix and the inline-review follow-up; both completed with 0 findings.

Inline comments were verified with Wyvern and Scribe agents before changes were made. The historical ExecPlan 1418 count was left unchanged because it records the earlier plan milestone; later implementation validation in the same document records the authoritative 1428 and final 1431 counts.

References

Add the pre-implementation ExecPlan for roadmap item 8.2.1. The plan
captures the scope, experimental wiring decision, validation steps, review
requirements, and approval gate for creating the
`rstest_helper_should_be_fixture` lint crate.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Review Change Stack

Walkthrough

Introduce an experimental Dylint lint crate rstest_helper_should_be_fixture that loads configuration from dylint.toml, normalises detection-options, and integrates into the suite and installer so it is enabled only when the --experimental flag or the suite feature is used.

Changes

Experimental rstest_helper_should_be_fixture lint crate bootstrap

Layer / File(s) Summary
Lint crate scaffold and driver bootstrap
crates/rstest_helper_should_be_fixture/Cargo.toml, crates/rstest_helper_should_be_fixture/src/lib.rs, crates/rstest_helper_should_be_fixture/src/driver.rs
New crate manifest configures library types (cdylib/rlib), feature gates (dylint-driver, constituent), and optional dependencies. Library module conditionally wires the driver module when the dylint-driver feature is enabled, or provides a stub when disabled. Driver module defines Config with normalisation methods for thresholds and provider attributes, registers RstestHelperShouldBeFixture as a Warn lint pass that loads configuration and initialises detection options during check_crate, and includes unit tests for configuration deserialisation, threshold clamping, attribute normalisation, and detection-option expansion.
Suite and installer integration wiring
suite/Cargo.toml, suite/src/driver.rs, suite/src/lints.rs, installer/src/resolution.rs, installer/src/builder.rs, installer/src/main.rs, installer/src/error.rs
Suite adds the experimental-rstest-helper-should-be-fixture feature and optional dependency, conditionally includes RstestHelperShouldBeFixture in the combined late-lint pass, and registers the lint in SUITE_LINTS and SUITE_LINT_DECLS under the feature gate. Installer populates EXPERIMENTAL_LINT_CRATES with the new crate name, adds is_experimental_crate(), and changes validate_crate_names() to accept CrateResolutionOptions so experimental crates are rejected unless options.experimental is true. Unit and builder tests updated to reflect the experimental feature behaviour.
Tests and behaviour scenarios
installer/tests/*, installer/tests/features/installer.feature
BDD tests extended: new steps and scenarios validate experimental crate name handling and CLI dry-run rejection when --experimental is not provided; CLI support helpers and assertions added to configure a dry run with the experimental lint and assert the opt-in message. Installer behaviour-core tests record validation error messages and the experimental flag in their world state.
Documentation, execplan and roadmap
docs/users-guide.md, docs/developers-guide.md, docs/lints-for-rstest-fixtures-and-test-hygiene.md, docs/execplans/8-2-1-create-the-rstest-helper-lint-crate.md, docs/roadmap.md
Users and developers guides updated to document the experimental lint, feature-gate semantics, example dylint.toml config block, and the installer opt-in requirement. ExecPlan records scope, decisions and acceptance criteria for 8.2.1; roadmap marks 8.2.1 complete.

Sequence Diagram(s)

sequenceDiagram
    participant Installer as whitaker-installer
    participant Resolution as installer/resolution.rs
    participant SuiteCargo as suite/Cargo.toml
    participant SuiteDriver as suite/src/driver.rs
    participant RstestCrate as rstest_helper_should_be_fixture

    Installer->>Resolution: validate_crate_names(names, options)
    Resolution->>Resolution: check EXPERIMENTAL_LINT_CRATES / is_experimental_crate
    Resolution-->>Installer: validation result (error if no --experimental)
    Installer->>SuiteCargo: enable feature experimental-rstest-helper-should-be-fixture
    SuiteCargo->>SuiteDriver: include optional rstest_helper_should_be_fixture dep
    SuiteDriver->>RstestCrate: activate dylint-driver feature
    SuiteDriver->>SuiteDriver: include RstestHelperShouldBeFixture in suite pass
Loading

Possibly related PRs

  • leynos/whitaker#81: Changes the installer resolver/test harness that this PR's experimental-lint validation builds upon.
  • leynos/whitaker#145: Modifies EXPERIMENTAL_LINT_CRATES handling and suite wiring touching the same experimental-lint paths.

Suggested reviewers

  • codescene-delta-analysis

Suggested labels

Roadmap

Poem

🎯 A fixture lint inhales the repo air,
Gated, quiet, its defaults set to keep,
Tests whisper checks and docs mark the step,
Installer guards the key—opt-in required,
The roadmap ticks, the milestone sleeps.


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (2 errors, 2 warnings)

Check name Status Explanation Resolution
Testing (Overall) ❌ Error check_crate() and load_configuration() are untested; diagnostic-silent implementation means check_crate() could be a no-op without test failure. Add integration tests verifying check_crate() invocation; add unit tests for load_configuration() error handling and SharedConfig::load() initialisation.
Module-Level Documentation ❌ Error The stub module in crates/rstest_helper_should_be_fixture/src/lib.rs lacks module-level documentation. All other new modules are properly documented. Add a module-level docstring to the stub module explaining its purpose as a stub used when the dylint-driver feature is disabled.
User-Facing Documentation ⚠️ Warning README.md fails to signpost the new experimental lint category—states "eight lints" whilst listing nine, and does not mention experimental functionality requiring opt-in. Add experimental lint category signpost to README.md and correct the lint count description to clarify experimental vs. standard lints.
Testing (Property / Proof) ⚠️ Warning Configuration normalisation and experimental validation introduce invariants lacking property-based tests for idempotence or bounded model checking per repository's established patterns. Add proptest property tests verifying idempotence of Config::normalized() across threshold and attribute input ranges, aligned with existing Kani/proptest usage.
✅ Passed checks (14 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Developer Documentation ✅ Passed Developers-guide documents experimental lint setup; design document has 8.2.1 decisions; roadmap 8.2.1 checked; ExecPlan marked COMPLETE; public APIs documented; no translation issues.
Testing (Unit And Behavioural) ✅ Passed Tests cover: 7 unit tests for crate config, 2 parametrised tests for experimental validation, and 3 BDD scenarios for crate resolution and CLI rejection without opt-in.
Testing (Compile-Time / Ui) ✅ Passed Lint is diagnostic-silent per 8.2.1 scope—no compile-time/UI tests required. The pass only loads configuration; diagnostic testing deferred to 8.2.2–8.2.4.
Unit Architecture ✅ Passed Configuration is testable independently; fallible operations explicit; no hard-coded globals; state mutations visible via trait contract; validation enforces experimental opt-in at boundaries.
Domain Architecture ✅ Passed Config normalisation is pure; installer validation enforces opt-in at domain layer; errors are domain-shaped; CLI and Dylint concerns isolated via adapters and feature gates.
Observability ✅ Passed Debug-level configuration error logging with silent fallback follows approved design; observable behaviour includes registration, config tests, and experimental opt-in gate.
Security And Privacy ✅ Passed No secrets found. Experimental lint gate enforcement prevents bypass. Configuration safely rejects unknown fields and contains no sensitive data.
Performance And Resource Use ✅ Passed Resource allocations bounded by design; I/O operations execute appropriately at startup/per-compilation; no algorithmic regressions, unnecessary cloning, or hot-path blocking identified.
Concurrency And State ✅ Passed PR introduces no shared state, locks, channels, or concurrency concerns. Lint configuration is instance-owned and functional; validation is pure. Not applicable to this change.
Title check ✅ Passed The title 'Create rstest helper fixture lint crate (8.2.1)' directly aligns with the primary change—scaffolding the experimental rstest_helper_should_be_fixture Dylint crate—and includes the required roadmap item reference.
Description check ✅ Passed The pull request description comprehensively describes the changeset: adding the experimental rstest_helper_should_be_fixture Dylint crate, wiring it into installer resolution, enforcing --experimental opt-in, and updating documentation.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 8-2-1-create-the-rstest-helper-lint-crate

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

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 2500000 diff characters.

Please try again later or upgrade to continue using Sourcery

codescene-delta-analysis[bot]

This comment was marked as outdated.

Update the ExecPlan progress section after opening the draft pull request.
This keeps the living plan aligned with the branch state without changing the
implementation scope.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Create the experimental `rstest_helper_should_be_fixture` Dylint crate
and wire it into the installer and suite behind the experimental feature.

Add configuration defaults and unit coverage for the bootstrap policy,
update registration behaviour coverage, and document the experimental
user-facing behaviour for roadmap item 8.2.1.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Update the ExecPlan status after pushing the implementation and refreshing
the draft PR for roadmap item 8.2.1.
codescene-delta-analysis[bot]

This comment was marked as outdated.

Update the ExecPlan with the final post-push CodeRabbit confirmation
attempt, which remained blocked by a recoverable service rate limit.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos leynos marked this pull request as ready for review May 20, 2026 09:41
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

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 2500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai coderabbitai Bot added the Roadmap label May 20, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94975451d6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/// the `--experimental` flag. The list is currently empty.
pub const EXPERIMENTAL_LINT_CRATES: &[&str] = &[];
/// the `--experimental` flag.
pub const EXPERIMENTAL_LINT_CRATES: &[&str] = &["rstest_helper_should_be_fixture"];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enforce --experimental for explicit experimental lint builds

Adding rstest_helper_should_be_fixture to EXPERIMENTAL_LINT_CRATES makes whitaker-installer --lint rstest_helper_should_be_fixture valid even when --experimental is not set, because validate_crate_names accepts experimental crates unconditionally and resolve_crates returns explicit --lint selections without checking the flag. This bypasses the documented opt-in gate for experimental lints and can unexpectedly build/run unstable checks in non-experimental flows.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/rstest_helper_should_be_fixture/src/lib.rs`:
- Around line 17-20: Add a module-level doc comment for the inline module `stub`
by adding a leading `//!` comment immediately before `mod stub { ... }` that
explains the module's purpose (a disabled stub used when the driver feature is
off) and notes the included public function
`rstest_helper_should_be_fixture_disabled_stub`. Ensure the comment is a
module-level `//!` (not `///`) so it satisfies the module documentation rule and
remains consistent with other modules.

In `@docs/execplans/8-2-1-create-the-rstest-helper-lint-crate.md`:
- Around line 274-281: Update the outcomes section to use the authoritative test
count: locate the sentence containing the text "`make test` succeeded with 1418
tests passed and 2 skipped under the default nextest profile" and change the
reported passed tests from 1418 to 1428 so it matches the validated counts
recorded earlier in the document (the entries near the previously noted lines
that reference the same `make test` outcome); ensure the single consistent
number (1428) is used everywhere in this document.

In `@docs/lints-for-rstest-fixtures-and-test-hygiene.md`:
- Around line 410-423: Move the "Implementation decisions (8.2.1)" subsection so
it appears after the "8.1.2" section to maintain numeric ordering; locate the
block that begins with the heading "Implementation decisions (8.2.1)" which
describes `rstest_helper_should_be_fixture`, `RSTEST_HELPER_SHOULD_BE_FIXTURE`,
`RstestDetectionOptions`, the experimental feature
`experimental-rstest-helper-should-be-fixture`, and `EXPERIMENTAL_LINT_CRATES`,
cut that entire paragraph(s) and paste them immediately after the "8.1.2"
heading to preserve strict numeric sequence and navigation.

In `@docs/users-guide.md`:
- Around line 516-550: Add the three missing standardized lint subsections into
the rstest_helper_should_be_fixture doc block: create "What is allowed" listing
examples such as single-use helper calls, provider-parameter uses per
provider_param_attributes, and cases below min_calls or min_distinct_tests;
create "What is denied" describing repeated helper invocations across tests that
meet or exceed min_calls and min_distinct_tests and non-provider uses (honoring
require_identical_fixture_arg_names and use_source_callee_fallback semantics);
and add "How to fix" with concrete remediation steps — replace repeated helper
calls with a #[fixture] parameter, rename arguments to match
require_identical_fixture_arg_names when needed, and prefer provider attributes
listed in provider_param_attributes — referencing the lint name
rstest_helper_should_be_fixture, its config keys (min_calls, min_distinct_tests,
require_identical_fixture_arg_names, provider_param_attributes,
use_source_callee_fallback) so readers can map rules to configuration.

In `@installer/src/builder.rs`:
- Around line 284-287: The test currently asserts a hard-coded string against
result; change it to compute the expected value from the
EXPERIMENTAL_LINT_CRATES constant so new experimental lints don't break the
test. Construct the expected composition by starting with "dylint-driver" and
then appending the crate names from EXPERIMENTAL_LINT_CRATES (preserving
whatever ordering the production code uses), join them with commas, and assert
that equals result (replace the literal in the assert_eq! with this computed
expected value). Ensure you reference EXPERIMENTAL_LINT_CRATES and the test
variable result when making the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ce7efa0a-9e4b-4a76-bbbd-3d46c70ca306

📥 Commits

Reviewing files that changed from the base of the PR and between 5165b34 and 9497545.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • crates/rstest_helper_should_be_fixture/Cargo.toml
  • crates/rstest_helper_should_be_fixture/src/driver.rs
  • crates/rstest_helper_should_be_fixture/src/lib.rs
  • docs/developers-guide.md
  • docs/execplans/8-2-1-create-the-rstest-helper-lint-crate.md
  • docs/lints-for-rstest-fixtures-and-test-hygiene.md
  • docs/roadmap.md
  • docs/users-guide.md
  • installer/src/builder.rs
  • installer/src/resolution.rs
  • installer/tests/behaviour_core.rs
  • suite/Cargo.toml
  • suite/src/driver.rs
  • suite/src/lints.rs

Comment on lines +17 to +20
mod stub {
#[expect(dead_code, reason = "stub used when the driver feature is disabled")]
pub fn rstest_helper_should_be_fixture_disabled_stub() {}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add a module-level //! doc comment to stub.

Document the inline stub module with a leading //! comment so module documentation rules remain consistent.

As per coding guidelines, “Every Rust module must begin with a module level (//!) comment explaining the module's purpose and utility”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/rstest_helper_should_be_fixture/src/lib.rs` around lines 17 - 20, Add
a module-level doc comment for the inline module `stub` by adding a leading
`//!` comment immediately before `mod stub { ... }` that explains the module's
purpose (a disabled stub used when the driver feature is off) and notes the
included public function `rstest_helper_should_be_fixture_disabled_stub`. Ensure
the comment is a module-level `//!` (not `///`) so it satisfies the module
documentation rule and remains consistent with other modules.

Comment on lines +274 to +281
The plan milestone has passed local validation:

- `make check-fmt` succeeded.
- `make markdownlint` succeeded with 0 Markdown errors.
- `make lint` succeeded.
- `make test` succeeded with 1418 tests passed and 2 skipped under the default
nextest profile.
- `coderabbit review --agent` completed with 0 findings after review fixes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix the inconsistent test-count evidence in the outcomes section.

Correct Line 279 to match the validated counts already recorded at Line 170 and
Line 174. Keep one authoritative number across the document.

Patch
-- `make test` succeeded with 1418 tests passed and 2 skipped under the default
+- `make test` succeeded with 1428 tests passed and 2 skipped under the default
  nextest profile.

Triage: [type:docstyle]

As per coding guidelines, docs/ must remain the source of truth for project
state and decisions.

🧰 Tools
🪛 LanguageTool

[style] ~279-~279: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... - make lint succeeded. - make test succeeded with 1418 tests passed and 2 skipped un...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/execplans/8-2-1-create-the-rstest-helper-lint-crate.md` around lines 274
- 281, Update the outcomes section to use the authoritative test count: locate
the sentence containing the text "`make test` succeeded with 1418 tests passed
and 2 skipped under the default nextest profile" and change the reported passed
tests from 1418 to 1428 so it matches the validated counts recorded earlier in
the document (the entries near the previously noted lines that reference the
same `make test` outcome); ensure the single consistent number (1428) is used
everywhere in this document.

Comment on lines +410 to +423
## Implementation decisions (8.2.1)

- `rstest_helper_should_be_fixture` now exists as an experimental Dylint crate.
The first implementation declares `RSTEST_HELPER_SHOULD_BE_FIXTURE`, loads
and normalizes the Lint A configuration defaults, and builds the shared
`RstestDetectionOptions` policy.
- The lint is intentionally diagnostic-silent in 8.2.1. Call-site collection,
aggregation, and user-facing suggestions remain assigned to 8.2.2 through
8.2.4 so this bootstrap does not claim analysis behaviour it does not yet
implement.
- The suite exposes the lint only through the experimental feature
`experimental-rstest-helper-should-be-fixture`. The installer derives that
feature from `EXPERIMENTAL_LINT_CRATES` when `--experimental` is enabled.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Reorder implementation-decision sections into numeric sequence.

Move the 8.2.1 section below 8.1.2 so implementation-decision headings remain
strictly ordered and easier to navigate during roadmap cross-referencing.

Triage: [type:docstyle]

🧰 Tools
🪛 LanguageTool

[uncategorized] ~418-~418: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...remain assigned to 8.2.2 through 8.2.4 so this bootstrap does not claim analysis ...

(COMMA_COMPOUND_SENTENCE_2)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/lints-for-rstest-fixtures-and-test-hygiene.md` around lines 410 - 423,
Move the "Implementation decisions (8.2.1)" subsection so it appears after the
"8.1.2" section to maintain numeric ordering; locate the block that begins with
the heading "Implementation decisions (8.2.1)" which describes
`rstest_helper_should_be_fixture`, `RSTEST_HELPER_SHOULD_BE_FIXTURE`,
`RstestDetectionOptions`, the experimental feature
`experimental-rstest-helper-should-be-fixture`, and `EXPERIMENTAL_LINT_CRATES`,
cut that entire paragraph(s) and paste them immediately after the "8.1.2"
heading to preserve strict numeric sequence and navigation.

Comment thread docs/users-guide.md
Comment on lines +516 to +550
### `rstest_helper_should_be_fixture`

<!-- markdownlint-disable-next-line MD024 -->
#### Purpose

Bootstraps the experimental lint that will recommend converting repeated helper
calls inside `#[rstest]` tests into injected `#[fixture]` parameters.

<!-- markdownlint-disable-next-line MD024 -->
#### Scope and behaviour

This lint is experimental. The current implementation registers the lint and
loads configuration defaults so teams can opt into the forthcoming rule without
yet receiving helper-call diagnostics. Call-site collection, cross-test
aggregation, and actionable diagnostics are tracked by the later roadmap items
8.2.2 through 8.2.4.

<!-- markdownlint-disable-next-line MD024 -->
#### Configuration

```toml
[rstest_helper_should_be_fixture]
min_calls = 2
min_distinct_tests = 2
require_identical_fixture_arg_names = false
provider_param_attributes = ["case", "values", "files", "future", "context"]
use_source_callee_fallback = false
```

`provider_param_attributes` lists `rstest` parameter attributes that should be
treated as data providers rather than fixture-local bindings. Entries may be
written either as bare names such as `case` or qualified names such as
`rstest::case`; Whitaker normalizes them to the shared detection policy.

______________________________________________________________________
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add the missing lint subsections for rule parity.

Complete the rstest_helper_should_be_fixture section with What is allowed,
What is denied, and How to fix so it matches the canonical lint-doc
structure used across this guide.

Patch sketch
 ### `rstest_helper_should_be_fixture`
@@
 #### Configuration
@@
 `provider_param_attributes` lists `rstest` parameter attributes that should be
 treated as data providers rather than fixture-local bindings. Entries may be
 written either as bare names such as `case` or qualified names such as
 `rstest::case`; Whitaker normalizes them to the shared detection policy.
+
+#### What is allowed
+
+- Repeated helper calls in `#[rstest]` tests while this bootstrap release
+  remains diagnostic-silent.
+- Any helper-call pattern when teams only opt in to configuration loading.
+
+#### What is denied
+
+- Nothing in 8.2.1: this milestone registers configuration and wiring only, and
+  does not emit call-site diagnostics yet.
+
+#### How to fix
+
+- No remediation is required in 8.2.1 because diagnostics are intentionally
+  deferred.
+- Prepare for later milestones by centralizing repeated setup helpers into
+  candidate `#[fixture]` functions where appropriate.

Triage: [type:docstyle]

As per coding guidelines, "Document each lint with consistent sections:
Purpose, Scope and behaviour, Configuration, What is allowed, What is denied,
How to fix".

🧰 Tools
🪛 LanguageTool

[uncategorized] ~528-~528: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...he lint and loads configuration defaults so teams can opt into the forthcoming rule...

(COMMA_COMPOUND_SENTENCE_2)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/users-guide.md` around lines 516 - 550, Add the three missing
standardized lint subsections into the rstest_helper_should_be_fixture doc
block: create "What is allowed" listing examples such as single-use helper
calls, provider-parameter uses per provider_param_attributes, and cases below
min_calls or min_distinct_tests; create "What is denied" describing repeated
helper invocations across tests that meet or exceed min_calls and
min_distinct_tests and non-provider uses (honoring
require_identical_fixture_arg_names and use_source_callee_fallback semantics);
and add "How to fix" with concrete remediation steps — replace repeated helper
calls with a #[fixture] parameter, rename arguments to match
require_identical_fixture_arg_names when needed, and prefer provider attributes
listed in provider_param_attributes — referencing the lint name
rstest_helper_should_be_fixture, its config keys (min_calls, min_distinct_tests,
require_identical_fixture_arg_names, provider_param_attributes,
use_source_callee_fallback) so readers can map rules to configuration.

Comment thread installer/src/builder.rs Outdated
Comment on lines +284 to +287
assert_eq!(
result,
"dylint-driver,experimental-rstest-helper-should-be-fixture"
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Remove hard-coded suite experimental feature expectations in the test.

Assert derived feature composition from EXPERIMENTAL_LINT_CRATES so the test remains stable when new experimental lints are added.

Patch
-        assert_eq!(
-            result,
-            "dylint-driver,experimental-rstest-helper-should-be-fixture"
-        );
+        let expected_experimental = Builder::experimental_features();
+        let expected = if expected_experimental.is_empty() {
+            "dylint-driver".to_owned()
+        } else {
+            format!("dylint-driver,{expected_experimental}")
+        };
+        assert_eq!(result, expected);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@installer/src/builder.rs` around lines 284 - 287, The test currently asserts
a hard-coded string against result; change it to compute the expected value from
the EXPERIMENTAL_LINT_CRATES constant so new experimental lints don't break the
test. Construct the expected composition by starting with "dylint-driver" and
then appending the crate names from EXPERIMENTAL_LINT_CRATES (preserving
whatever ordering the production code uses), join them with commas, and assert
that equals result (replace the literal in the assert_eq! with this computed
expected value). Ensure you reference EXPERIMENTAL_LINT_CRATES and the test
variable result when making the change.

Validate explicit `--lint` requests with the experimental option context so
experimental crates cannot bypass the documented `--experimental` gate.

Add core and CLI behaviour coverage for accepted opt-in requests and rejected
non-opt-in requests, and document the user-facing installer contract.
codescene-delta-analysis[bot]

This comment was marked as outdated.

@leynos leynos marked this pull request as draft May 20, 2026 11:40
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
docs/execplans/8-2-1-create-the-rstest-helper-lint-crate.md (1)

287-294: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Correct the inconsistent test count at Line 292.

Change 1418 tests passed to 1428 tests passed to match the authoritative counts recorded at Lines 170, 174, and 308.

📝 Proposed fix
-- `make test` succeeded with 1418 tests passed and 2 skipped under the default
+- `make test` succeeded with 1428 tests passed and 2 skipped under the default
  nextest profile.

Triage: [type:docstyle]

As per coding guidelines, docs/ must remain the source of truth for project state and decisions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/execplans/8-2-1-create-the-rstest-helper-lint-crate.md` around lines 287
- 294, Update the reported test count in the sentence that currently reads
"`make test` succeeded with 1418 tests passed and 2 skipped under the default
nextest profile." — change "1418 tests passed" to "1428 tests passed" so the
line matches the authoritative counts referenced elsewhere; ensure the rest of
the sentence ("and 2 skipped under the default nextest profile.") remains
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@docs/execplans/8-2-1-create-the-rstest-helper-lint-crate.md`:
- Around line 287-294: Update the reported test count in the sentence that
currently reads "`make test` succeeded with 1418 tests passed and 2 skipped
under the default nextest profile." — change "1418 tests passed" to "1428 tests
passed" so the line matches the authoritative counts referenced elsewhere;
ensure the rest of the sentence ("and 2 skipped under the default nextest
profile.") remains unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2d655594-a254-45a7-ab00-547d21de44e6

📥 Commits

Reviewing files that changed from the base of the PR and between 9497545 and 7e10a16.

📒 Files selected for processing (10)
  • docs/execplans/8-2-1-create-the-rstest-helper-lint-crate.md
  • docs/users-guide.md
  • installer/src/error.rs
  • installer/src/main.rs
  • installer/src/resolution.rs
  • installer/tests/behaviour_cli.rs
  • installer/tests/behaviour_cli/scenarios.rs
  • installer/tests/behaviour_cli/support.rs
  • installer/tests/behaviour_core.rs
  • installer/tests/features/installer.feature

Fix the still-valid inline review comments for the experimental rstest helper
lint bootstrap. Add module documentation for the disabled-driver stub, derive
the suite experimental feature expectation from `EXPERIMENTAL_LINT_CRATES`, and
fill in the users-guide and design-document documentation gaps.

Record the verification outcome in the ExecPlan, including the stale historical
test-count comment that was intentionally left unchanged.
Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Choose a reason for hiding this comment

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

Gates Failed
Enforce advisory code health rules (1 file with Large Method)

Gates Passed
5 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Enforce advisory code health rules Violations Code Health Impact
error.rs 1 advisory rule 9.53 → 9.51 Suppress

Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant