Skip to content

Harden workspace lint, format, and documentation gates - #346

Closed
leynos wants to merge 21 commits into
mainfrom
harden-lint-config
Closed

leynos wants to merge 21 commits into
mainfrom
harden-lint-config

Conversation

@leynos

@leynos leynos commented Aug 17, 2026 •

Copy link
Copy Markdown
Owner

Superseded by a stack of eight PRs

This branch carried the whole lint-hardening effort as a single 429-file change, which is not reviewable. It has been decomposed into a stack of focused, individually green PRs, each based on the one below it:

  1. #362 Sweep test, fixture, and assertion quality — base main
  2. #363 Correct en-GB-oxendict spellings in code symbols and prose
  3. #364 Adopt directory-based module structure
  4. #365 Fix workspace-lint violations across support crates
  5. #369 Fix workspace-lint violations across the installer
  6. #370 Standardize Rust formatting
  7. #371 Harden workspace lint, format, and documentation gates
  8. #372 Run the Whitaker suite over Whitaker's own sources

The fixes land before the configuration that demands them, so every PR in the stack passes its own gates rather than only the final tip. The two mechanical changes — the rustfmt reformat and the spelling renames — are isolated so they do not bury the substantive diffs.

The stack is not merely a re-slicing of this branch: it also carries a seven-category test-quality sweep that this branch lacked, and turning the gates on in their own PR surfaced four findings that were invisible here, because several crates were shielded by local lint tables or were inheriting from a workspace that had no clippy table at all.

Closing in favour of the stack.

References

@coderabbitai

coderabbitai Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 428 files, which is 128 over the limit of 300.

To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0aae9b99-bf04-43d9-a93a-5a803f725fdf

📥 Commits

Reviewing files that changed from the base of the PR and between ab2bc51 and afb1e4a.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (428)
  • .config/nextest.toml
  • .github/workflows/ci.yml
  • .rustfmt.toml
  • AGENTS.md
  • Cargo.toml
  • Makefile
  • common/Cargo.toml
  • common/locales/cy/common.ftl
  • common/locales/en-GB/no_expect_outside_tests.ftl
  • common/src/attributes/attribute.rs
  • common/src/attributes/helpers.rs
  • common/src/attributes/kind.rs
  • common/src/attributes/mod.rs
  • common/src/attributes/path.rs
  • common/src/attributes/tests.rs
  • common/src/brain_trait_metrics/diagnostic.rs
  • common/src/brain_trait_metrics/diagnostic_tests.rs
  • common/src/brain_trait_metrics/evaluation.rs
  • common/src/brain_trait_metrics/evaluation_tests.rs
  • common/src/brain_trait_metrics/item.rs
  • common/src/brain_trait_metrics/metrics.rs
  • common/src/brain_trait_metrics/mod.rs
  • common/src/brain_trait_metrics/tests.rs
  • common/src/brain_type_metrics/cognitive_complexity.rs
  • common/src/brain_type_metrics/cognitive_complexity_tests.rs
  • common/src/brain_type_metrics/diagnostic.rs
  • common/src/brain_type_metrics/diagnostic_tests.rs
  • common/src/brain_type_metrics/evaluation.rs
  • common/src/brain_type_metrics/evaluation_tests.rs
  • common/src/brain_type_metrics/foreign_reach.rs
  • common/src/brain_type_metrics/mod.rs
  • common/src/brain_type_metrics/tests.rs
  • common/src/complexity_signal.rs
  • common/src/context.rs
  • common/src/decomposition_advice/community.rs
  • common/src/decomposition_advice/community_kani/propagate_labels.rs
  • common/src/decomposition_advice/note.rs
  • common/src/decomposition_advice/note_tests.rs
  • common/src/decomposition_advice/profile.rs
  • common/src/decomposition_advice/suggestion.rs
  • common/src/decomposition_advice/tests/adjacency.rs
  • common/src/decomposition_advice/tests/cosine_threshold.rs
  • common/src/decomposition_advice/tests/mod.rs
  • common/src/decomposition_advice/tests/propagation.rs
  • common/src/decomposition_advice/tests/test_fixtures.rs
  • common/src/decomposition_advice/tests/vector_algebra.rs
  • common/src/decomposition_advice/vector.rs
  • common/src/diagnostics.rs
  • common/src/dylint_entry.rs
  • common/src/expr.rs
  • common/src/i18n/diagnostics.rs
  • common/src/i18n/helpers.rs
  • common/src/i18n/loader.rs
  • common/src/i18n/locales.rs
  • common/src/i18n/mod.rs
  • common/src/i18n/selection.rs
  • common/src/i18n/testing.rs
  • common/src/i18n/tests.rs
  • common/src/lcom4/extract.rs
  • common/src/lcom4/mod.rs
  • common/src/lcom4/tests.rs
  • common/src/lib.rs
  • common/src/path.rs
  • common/src/rstest/argument_fingerprint.rs
  • common/src/rstest/detection.rs
  • common/src/rstest/mod.rs
  • common/src/rstest/paragraph_fingerprint.rs
  • common/src/rstest/parameter.rs
  • common/src/rstest/span.rs
  • common/src/rstest/tests/fingerprint.rs
  • common/src/rstest/tests/fingerprint_props.rs
  • common/src/rstest/tests/mod.rs
  • common/src/span.rs
  • common/src/test_support/decomposition.rs
  • common/src/test_support/decomposition_adjacency.rs
  • common/src/test_support/decomposition_label_propagation.rs
  • common/src/test_support/decomposition_vector_algebra.rs
  • common/src/test_support/fixtures.rs
  • common/src/test_support/mod.rs
  • common/src/test_support/ui.rs
  • common/tests/brain_trait_evaluation_behaviour.rs
  • common/tests/brain_trait_metrics_behaviour.rs
  • common/tests/brain_type_evaluation_behaviour.rs
  • common/tests/brain_type_metrics_behaviour.rs
  • common/tests/cognitive_complexity_behaviour.rs
  • common/tests/complexity_signal_behaviour.rs
  • common/tests/context_behaviour.rs
  • common/tests/cosine_threshold_behaviour.rs
  • common/tests/decomposition_adjacency_behaviour.rs
  • common/tests/decomposition_advice_behaviour.rs
  • common/tests/decomposition_diagnostic_notes_behaviour.rs
  • common/tests/decomposition_label_propagation_behaviour.rs
  • common/tests/decomposition_vector_algebra_behaviour.rs
  • common/tests/features/brain_trait_metrics.feature
  • common/tests/features/cognitive_complexity.feature
  • common/tests/features/context_detection.feature
  • common/tests/features/decomposition_advice.feature
  • common/tests/features/rstest_detection.feature
  • common/tests/i18n_behaviour.rs
  • common/tests/i18n_packaging.rs
  • common/tests/i18n_quality/ftl_smoke_behaviour.rs
  • common/tests/i18n_quality/suite.rs
  • common/tests/lcom4_behaviour.rs
  • common/tests/localizer_helpers.rs
  • common/tests/method_extraction_behaviour.rs
  • common/tests/rstest_detection_behaviour.rs
  • common/tests/rstest_fingerprint_behaviour.rs
  • common/tests/rstest_span_recovery_behaviour.rs
  • common/tests/support/i18n_helpers.rs
  • crates/bumpy_road_function/Cargo.toml
  • crates/bumpy_road_function/src/analysis.rs
  • crates/bumpy_road_function/src/driver/config.rs
  • crates/bumpy_road_function/src/driver/diagnostic.rs
  • crates/bumpy_road_function/src/driver/mod.rs
  • crates/bumpy_road_function/src/driver/segment_builder.rs
  • crates/bumpy_road_function/src/lib.rs
  • crates/bumpy_road_function/tests/analysis_behaviour.rs
  • crates/bumpy_road_function/tests/features/bumpy_road.feature
  • crates/bumpy_road_function/tests/ui.rs
  • crates/clippy_utils/Cargo.toml
  • crates/clippy_utils/src/lib.rs
  • crates/conditional_max_n_branches/Cargo.toml
  • crates/conditional_max_n_branches/src/driver.rs
  • crates/conditional_max_n_branches/src/lib.rs
  • crates/conditional_max_n_branches/src/lib_ui_tests.rs
  • crates/conditional_max_n_branches/src/tests/behaviour.rs
  • crates/function_attrs_follow_docs/Cargo.toml
  • crates/function_attrs_follow_docs/src/driver.rs
  • crates/function_attrs_follow_docs/src/lib.rs
  • crates/function_attrs_follow_docs/src/tests/localization.rs
  • crates/function_attrs_follow_docs/src/tests/order_detection.rs
  • crates/function_attrs_follow_docs/src/tests/ui.rs
  • crates/function_attrs_follow_docs/tests/features/function_attrs_localization.feature
  • crates/module_max_lines/Cargo.toml
  • crates/module_max_lines/src/driver.rs
  • crates/module_max_lines/src/lib.rs
  • crates/module_max_lines/src/lib_ui_tests.rs
  • crates/module_must_have_inner_docs/Cargo.toml
  • crates/module_must_have_inner_docs/src/driver/inner_attr.rs
  • crates/module_must_have_inner_docs/src/driver/mod.rs
  • crates/module_must_have_inner_docs/src/driver/parser.rs
  • crates/module_must_have_inner_docs/src/lib.rs
  • crates/module_must_have_inner_docs/src/tests/behaviour.rs
  • crates/module_must_have_inner_docs/src/tests/classifier.rs
  • crates/module_must_have_inner_docs/src/tests/span_to_snippet.rs
  • crates/module_must_have_inner_docs/src/tests/ui.rs
  • crates/no_expect_outside_tests/Cargo.toml
  • crates/no_expect_outside_tests/examples/fail_expect_in_rstest_non_test_module.stderr
  • crates/no_expect_outside_tests/examples/fail_expect_in_tokio_crate_non_test_fn.rs
  • crates/no_expect_outside_tests/examples/fail_expect_in_tokio_crate_non_test_fn.stderr
  • crates/no_expect_outside_tests/src/behaviour.rs
  • crates/no_expect_outside_tests/src/context/mod.rs
  • crates/no_expect_outside_tests/src/context/tests.rs
  • crates/no_expect_outside_tests/src/dependency_rlib_tests.rs
  • crates/no_expect_outside_tests/src/diagnostics.rs
  • crates/no_expect_outside_tests/src/driver/mod.rs
  • crates/no_expect_outside_tests/src/driver/tests.rs
  • crates/no_expect_outside_tests/src/lib.rs
  • crates/no_expect_outside_tests/src/lib_ui_tests.rs
  • crates/no_expect_outside_tests/src/tests.rs
  • crates/no_expect_outside_tests/src/tests/localization.rs
  • crates/no_expect_outside_tests/src/tests/receiver_type_edge_cases.rs
  • crates/no_expect_outside_tests/tests/features/context_summary.feature
  • crates/no_expect_outside_tests/tests/features/localization.feature
  • crates/no_expect_outside_tests/ui/fail_expect_in_file_backed_non_test_fn.stderr
  • crates/no_expect_outside_tests/ui/fail_expect_in_fn.stderr
  • crates/no_expect_outside_tests/ui/fail_expect_with_cfg_attr.stderr
  • crates/no_std_fs_operations/Cargo.toml
  • crates/no_std_fs_operations/src/behaviour.rs
  • crates/no_std_fs_operations/src/config.rs
  • crates/no_std_fs_operations/src/config_tests.rs
  • crates/no_std_fs_operations/src/diagnostics.rs
  • crates/no_std_fs_operations/src/driver.rs
  • crates/no_std_fs_operations/src/exclusion.rs
  • crates/no_std_fs_operations/src/exclusion_behaviour.rs
  • crates/no_std_fs_operations/src/lib.rs
  • crates/no_std_fs_operations/src/tests/ui.rs
  • crates/no_std_fs_operations/src/usage/mod.rs
  • crates/no_std_fs_operations/src/usage/tests.rs
  • crates/no_std_fs_operations/tests/features/localization.feature
  • crates/no_std_fs_operations/tests/integration_exclusion.rs
  • crates/no_std_fs_operations/tests/no_default_features_build.rs
  • crates/no_std_fs_operations/tests/test_support/mod.rs
  • crates/no_unwrap_or_else_panic/Cargo.toml
  • crates/no_unwrap_or_else_panic/examples/fail_unwrap_in_rstest_non_test_module.rs
  • crates/no_unwrap_or_else_panic/src/context/mod.rs
  • crates/no_unwrap_or_else_panic/src/context/tests.rs
  • crates/no_unwrap_or_else_panic/src/diagnostics.rs
  • crates/no_unwrap_or_else_panic/src/driver.rs
  • crates/no_unwrap_or_else_panic/src/lib.rs
  • crates/no_unwrap_or_else_panic/src/lib_ui_tests.rs
  • crates/no_unwrap_or_else_panic/src/panic_detector.rs
  • crates/no_unwrap_or_else_panic/src/policy.rs
  • crates/no_unwrap_or_else_panic/src/tests/behaviour.rs
  • crates/rstest_helper_should_be_fixture/Cargo.toml
  • crates/rstest_helper_should_be_fixture/src/collector.rs
  • crates/rstest_helper_should_be_fixture/src/collector_tests.rs
  • crates/rstest_helper_should_be_fixture/src/driver.rs
  • crates/rstest_helper_should_be_fixture/src/driver_tests.rs
  • crates/rstest_helper_should_be_fixture/src/lib.rs
  • crates/rstest_helper_should_be_fixture/src/visitor.rs
  • crates/rstest_helper_should_be_fixture/tests/ui.rs
  • crates/rstest_helper_should_be_fixture/tests/ui/harness_lock.rs
  • crates/rstest_helper_should_be_fixture/tests/ui/lock_model.rs
  • crates/rustc_ast/Cargo.toml
  • crates/rustc_attr_data_structures/Cargo.toml
  • crates/rustc_hir/Cargo.toml
  • crates/rustc_lint/Cargo.toml
  • crates/rustc_middle/Cargo.toml
  • crates/rustc_session/Cargo.toml
  • crates/rustc_span/Cargo.toml
  • crates/test_must_not_have_example/Cargo.toml
  • crates/test_must_not_have_example/src/behaviour.rs
  • crates/test_must_not_have_example/src/driver.rs
  • crates/test_must_not_have_example/src/heuristics.rs
  • crates/test_must_not_have_example/src/lib.rs
  • crates/test_must_not_have_example/src/lib_ui_tests.rs
  • crates/whitaker_clones_core/Cargo.toml
  • crates/whitaker_clones_core/build.rs
  • crates/whitaker_clones_core/build_support.rs
  • crates/whitaker_clones_core/src/ast/features.rs
  • crates/whitaker_clones_core/src/ast/hash.rs
  • crates/whitaker_clones_core/src/ast/kani.rs
  • crates/whitaker_clones_core/src/ast/lowering.rs
  • crates/whitaker_clones_core/src/ast/lowering_tests.rs
  • crates/whitaker_clones_core/src/ast/mod.rs
  • crates/whitaker_clones_core/src/ast/tests.rs
  • crates/whitaker_clones_core/src/ast/tree.rs
  • crates/whitaker_clones_core/src/hashing.rs
  • crates/whitaker_clones_core/src/index/error.rs
  • crates/whitaker_clones_core/src/index/fragment_id.rs
  • crates/whitaker_clones_core/src/index/kani.rs
  • crates/whitaker_clones_core/src/index/lsh.rs
  • crates/whitaker_clones_core/src/index/minhash.rs
  • crates/whitaker_clones_core/src/index/mod.rs
  • crates/whitaker_clones_core/src/index/tests.rs
  • crates/whitaker_clones_core/src/index/types.rs
  • crates/whitaker_clones_core/src/lib.rs
  • crates/whitaker_clones_core/src/run0/emit.rs
  • crates/whitaker_clones_core/src/run0/error.rs
  • crates/whitaker_clones_core/src/run0/score.rs
  • crates/whitaker_clones_core/src/run0/span.rs
  • crates/whitaker_clones_core/src/run0/test_helpers.rs
  • crates/whitaker_clones_core/src/run0/tests.rs
  • crates/whitaker_clones_core/src/run0/tests_emit.rs
  • crates/whitaker_clones_core/src/run0/types.rs
  • crates/whitaker_clones_core/src/token/fingerprint.rs
  • crates/whitaker_clones_core/src/token/mod.rs
  • crates/whitaker_clones_core/src/token/normalize.rs
  • crates/whitaker_clones_core/src/token/tests.rs
  • crates/whitaker_clones_core/src/token/types.rs
  • crates/whitaker_clones_core/tests/ast_boundary.rs
  • crates/whitaker_clones_core/tests/ast_feature_extraction_behaviour.rs
  • crates/whitaker_clones_core/tests/build_script_integration.rs
  • crates/whitaker_clones_core/tests/build_script_parsing.rs
  • crates/whitaker_clones_core/tests/candidate_pair_behaviour.rs
  • crates/whitaker_clones_core/tests/min_hash_lsh_behaviour.rs
  • crates/whitaker_clones_core/tests/run0_sarif_behaviour.rs
  • crates/whitaker_clones_core/tests/token_pass_behaviour.rs
  • crates/whitaker_sarif/Cargo.toml
  • crates/whitaker_sarif/src/builders/location_builder.rs
  • crates/whitaker_sarif/src/builders/log_builder.rs
  • crates/whitaker_sarif/src/builders/result_builder.rs
  • crates/whitaker_sarif/src/builders/run_builder.rs
  • crates/whitaker_sarif/src/error.rs
  • crates/whitaker_sarif/src/lib.rs
  • crates/whitaker_sarif/src/merge.rs
  • crates/whitaker_sarif/src/model/descriptor.rs
  • crates/whitaker_sarif/src/model/location.rs
  • crates/whitaker_sarif/src/model/log.rs
  • crates/whitaker_sarif/src/model/mod.rs
  • crates/whitaker_sarif/src/model/result.rs
  • crates/whitaker_sarif/src/model/run.rs
  • crates/whitaker_sarif/src/paths.rs
  • crates/whitaker_sarif/src/rules.rs
  • crates/whitaker_sarif/src/test_support.rs
  • crates/whitaker_sarif/src/whitaker_properties.rs
  • crates/whitaker_sarif/tests/sarif_behaviour.rs
  • crates/whitaker_test_macros/Cargo.toml
  • crates/whitaker_test_macros/src/lib.rs
  • docs/developers-guide.md
  • docs/execplans/2-2-5-test-must-not-have-example-lint.md
  • docs/execplans/3-4-4-install-prebuilt-artefacts.md
  • docs/execplans/3.4.6. Record download-versus-build rates.md
  • docs/execplans/7-1-1-whitaker-sarif-crate.md
  • docs/execplans/7-2-8-kani-verification-of-bounded-lsh-index-invariants.md
  • docs/execplans/7-3-1-map-candidate-spans-and-extract-ast-feature-vectors.md
  • docs/execplans/8-2-1-create-the-rstest-helper-lint-crate.md
  • docs/execplans/8-2-2-call-site-collection-in-rstest-tests.md
  • docs/execplans/installer-does-not-install-toolchain.md
  • docs/execplans/issue-110-ambiguous-name-reported-by-dylint.md
  • docs/execplans/issue-94-dual-ownership-of-binary.md
  • docs/local-validation-of-github-actions-with-act-and-pytest.md
  • docs/rstest-bdd-users-guide.md
  • docs/scripting-standards.md
  • docs/whitaker-clone-detector-design.md
  • docs/whitaker-dylint-suite-design.md
  • dylint.toml
  • installer/Cargo.toml
  • installer/src/artefact/download.rs
  • installer/src/artefact/extraction.rs
  • installer/src/artefact/git_sha.rs
  • installer/src/artefact/manifest.rs
  • installer/src/artefact/manifest_parser.rs
  • installer/src/artefact/manifest_tests.rs
  • installer/src/artefact/naming.rs
  • installer/src/artefact/packaging.rs
  • installer/src/artefact/packaging_tests.rs
  • installer/src/artefact/schema_version.rs
  • installer/src/artefact/sha256_digest.rs
  • installer/src/artefact/target.rs
  • installer/src/artefact/toolchain_channel.rs
  • installer/src/artefact/verification.rs
  • installer/src/bin/package_dependency_binary.rs
  • installer/src/bin/package_installer_bin.rs
  • installer/src/bin/package_lints.rs
  • installer/src/binstall_metadata.rs
  • installer/src/binstall_metadata_tests.rs
  • installer/src/builder.rs
  • installer/src/cli.rs
  • installer/src/cli_tests.rs
  • installer/src/crate_name.rs
  • installer/src/dependency_binaries/install/checksum.rs
  • installer/src/dependency_binaries/install/downloader.rs
  • installer/src/dependency_binaries/install/downloader_boundary_non_utf8_tests.rs
  • installer/src/dependency_binaries/install/downloader_boundary_tests.rs
  • installer/src/dependency_binaries/install/downloader_tests.rs
  • installer/src/dependency_binaries/install/extractor.rs
  • installer/src/dependency_binaries/install/http_test_server.rs
  • installer/src/dependency_binaries/install/installer.rs
  • installer/src/dependency_binaries/install/metadata.rs
  • installer/src/dependency_binaries/install/mod.rs
  • installer/src/dependency_binaries/install/tests.rs
  • installer/src/dependency_binaries/manifest.rs
  • installer/src/dependency_binaries/mod.rs
  • installer/src/dependency_packaging.rs
  • installer/src/dependency_packaging_tests.rs
  • installer/src/deps/install.rs
  • installer/src/deps/install_repository.rs
  • installer/src/deps/install_tests.rs
  • installer/src/deps/mod.rs
  • installer/src/deps/path_tests.rs
  • installer/src/deps/tests.rs
  • installer/src/deps/tests_repository.rs
  • installer/src/dirs.rs
  • installer/src/error.rs
  • installer/src/git.rs
  • installer/src/hex.rs
  • installer/src/install_flow/mod.rs
  • installer/src/install_flow/tests.rs
  • installer/src/install_metrics.rs
  • installer/src/install_metrics_tests.rs
  • installer/src/installer_packaging.rs
  • installer/src/installer_packaging_tests.rs
  • installer/src/lib.rs
  • installer/src/list.rs
  • installer/src/list_output.rs
  • installer/src/list_tests.rs
  • installer/src/main.rs
  • installer/src/output.rs
  • installer/src/pipeline.rs
  • installer/src/pipeline_staging_tests.rs
  • installer/src/pipeline_tests.rs
  • installer/src/prebuilt.rs
  • installer/src/prebuilt_path.rs
  • installer/src/prebuilt_tests.rs
  • installer/src/resolution.rs
  • installer/src/scanner.rs
  • installer/src/staged_suite.rs
  • installer/src/stager.rs
  • installer/src/test_utils/dependency_binary_helpers.rs
  • installer/src/test_utils/dependency_binary_helpers_fakes.rs
  • installer/src/test_utils/dependency_binary_helpers_tests.rs
  • installer/src/test_utils/mod.rs
  • installer/src/tests/fast_path.rs
  • installer/src/tests/mod.rs
  • installer/src/toolchain/mod.rs
  • installer/src/toolchain/tests/failure_mocks/mod.rs
  • installer/src/toolchain/tests/mod.rs
  • installer/src/toolchain/tests/test_helpers.rs
  • installer/src/version.rs
  • installer/src/workspace.rs
  • installer/src/workspace_tests.rs
  • installer/src/wrapper.rs
  • installer/tests/behaviour_artefact.rs
  • installer/tests/behaviour_artefact_packaging.rs
  • installer/tests/behaviour_binstall.rs
  • installer/tests/behaviour_cli.rs
  • installer/tests/behaviour_cli/scenarios.rs
  • installer/tests/behaviour_cli/support.rs
  • installer/tests/behaviour_cli/support_assertions.rs
  • installer/tests/behaviour_core.rs
  • installer/tests/behaviour_dependency_binaries.rs
  • installer/tests/behaviour_docs.rs
  • installer/tests/behaviour_install_metrics.rs
  • installer/tests/behaviour_installer_release.rs
  • installer/tests/behaviour_prebuilt.rs
  • installer/tests/behaviour_staging.rs
  • installer/tests/behaviour_toolchain.rs
  • installer/tests/behaviour_workflows.rs
  • installer/tests/doc_extraction/extraction.rs
  • installer/tests/features/install_metrics.feature
  • installer/tests/support/mod.rs
  • installer/tests/toolchain_steps/mod.rs
  • installer/tests/toolchain_steps/scenario_setup.rs
  • installer/tests/ui.rs
  • rust-toolchain.toml
  • src/config.rs
  • src/hir/mod.rs
  • src/hir/tests.rs
  • src/lib.rs
  • src/lints/template/mod.rs
  • src/lints/template/validation.rs
  • src/testing/ui/mod.rs
  • src/testing/ui/tests.rs
  • src/testing/ui/toolchain.rs
  • suite/Cargo.toml
  • suite/src/driver.rs
  • suite/tests/registration.rs
  • tests/build_config.rs
  • tests/config_loading.rs
  • tests/lint_template.rs
  • tests/locale_resolution.rs
  • tests/nextest_ui_filter.rs
  • tests/support/locale.rs
  • tests/ui_harness.rs
  • typos.local.toml
  • typos.toml

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

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


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

@sourcery-ai

sourcery-ai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR hardens lint, formatting, and documentation gates across the entire Whitaker workspace by centralizing lint configuration at the workspace level, enforcing stricter Clippy and Rust lints (including forbidding unsafe code), adding a shared rustfmt configuration, extending test tooling to run doctests with warnings denied, and ensuring the toolchain includes rust-analyzer.

Sequence diagram for hardened test and documentation lint gate

sequenceDiagram
  actor Developer
  participant Makefile
  participant Cargo

  Developer->>Makefile: make test
  Makefile->>Cargo: test (RUSTFLAGS="-C prefer-dynamic ...")
  Makefile->>Cargo: test --workspace --doc --all-features (RUSTFLAGS="$(RUST_FLAGS)")
Loading

File-Level Changes

Change Details Files
Centralize and harden workspace-level lint policy for Clippy and Rust lints, including forbidding unsafe code and adding stricter checks.
  • Promote root lints configuration from a crate-local [lints.clippy] table to [workspace.lints.clippy] so all member crates share the same Clippy policy.
  • Add new Clippy lints such as disallowed_methods and missing_assert_message to the workspace lint set while keeping existing pedantic and hygiene-related settings.
  • Strengthen Rust workspace lints by forbidding unsafe_code and retaining unknown_lints, renamed_and_removed_lints, missing_docs, and unexpected_cfgs with cfg(kani) check-cfg.
  • Switch member crates from local [lints.rust] and [lints.clippy] tables to a simple [lints] workspace = true declaration so they inherit the workspace-wide policy.
Cargo.toml
common/Cargo.toml
crates/no_unwrap_or_else_panic/Cargo.toml
crates/whitaker_sarif/Cargo.toml
crates/bumpy_road_function/Cargo.toml
crates/clippy_utils/Cargo.toml
crates/conditional_max_n_branches/Cargo.toml
crates/function_attrs_follow_docs/Cargo.toml
crates/module_max_lines/Cargo.toml
crates/module_must_have_inner_docs/Cargo.toml
crates/no_expect_outside_tests/Cargo.toml
crates/no_std_fs_operations/Cargo.toml
crates/rstest_helper_should_be_fixture/Cargo.toml
crates/rustc_ast/Cargo.toml
crates/rustc_attr_data_structures/Cargo.toml
crates/rustc_hir/Cargo.toml
crates/rustc_lint/Cargo.toml
crates/rustc_middle/Cargo.toml
crates/rustc_session/Cargo.toml
crates/rustc_span/Cargo.toml
crates/test_must_not_have_example/Cargo.toml
suite/Cargo.toml
Add a workspace-wide rustfmt configuration file to standardize formatting behavior using nightly-only options.
  • Introduce a .rustfmt.toml at the repo root enabling unstable_features and configuring import layout, grouping, comment wrapping, and various formatting preferences.
  • Configure options such as comment_width, imports_granularity, imports_layout, group_imports, wrap_comments, use_try_shorthand, hex_literal_case, format_strings, format_macro_matchers, fn_single_line, condense_wildcard_suffixes, and use_field_init_shorthand to match the estate standard.
.rustfmt.toml
Tighten the test/lint gate by running workspace doctests with warnings treated as errors.
  • Extend the Makefile test target to run cargo test --workspace --doc --all-features with RUSTFLAGS set so that doctests are executed in addition to the existing test runner invocation.
  • Maintain the existing behavior where rustdoc is already run with --cfg docsrs -D warnings under make lint while adding doctest coverage to make test.
Makefile
Ensure the toolchain definition includes rust-analyzer to support IDE tooling and analysis.
  • Modify rust-toolchain.toml to add rust-analyzer to the list of components requested alongside rustfmt, clippy, rustc-dev, llvm-tools-preview, and rust-src.
rust-toolchain.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

common/tests/decomposition_adjacency_behaviour.rs

Comment on file

            .neighbours_of(node)
            .ok_or_else(|| format!("node {node} is out of bounds"))?;
        let is_sorted = neighbours.windows(2).all(|pair| pair[0].0 <= pair[1].0);
        let is_sorted = neighbours.is_sorted_by_key(|neighbour| neighbour.0);

❌ New issue: Code Duplication
The module contains 2 functions with similar structure: then_neighbours_of_node_are_sorted,then_node_has_no_neighbours

@coderabbitai

This comment was marked as resolved.

codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

Prefer assertion macros with pure queries and fallible commands if needed.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

installer/src/cli_tests.rs

Comment on lines +187 to +190

    assert!(!args.lint_selection.individual_lints);
    assert!(!args.lint_selection.experimental);
    assert!(!args.execution.cranelift);
    assert!(!args.skip.skip_deps);

❌ New issue: Large Assertion Blocks
The test suite contains 4 assertion blocks with at least 4 assertions, threshold = 4

@leynos

leynos commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

installer/tests/behaviour_binstall.rs

Comment on lines +107 to +115

fn then_pkg_url_present(world: &mut BinstallWorld) -> Result<(), String> {
    let binstall = binstall_table(world)?;
    let pkg_url = table_str(binstall, "pkg-url")?;
    if pkg_url != PKG_URL_TEMPLATE {
        return Err(format!(
            "pkg-url mismatch: expected {PKG_URL_TEMPLATE}, got {pkg_url}"
        ));
    }
    Ok(())

❌ New issue: Code Duplication
The module contains 3 functions with similar structure: then_bin_dir_present,then_default_pkg_fmt,then_pkg_url_present

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message in a code block that I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

Code Duplication

installer/tests/behaviour_workflows.rs:

What lead to degradation?

The module contains 6 functions with similar structure: then_cli_exits_successfully,then_installation_succeeds_or_is_skipped,then_no_update_is_true,then_output_includes_library_path_instructions and 2 more functions

Why does this problem occur?

Duplicated code often leads to code that's harder to change since the same logical change has to be done in multiple functions. More duplication gives lower code health.

How to fix it?

A certain degree of duplicated code might be acceptable. The problems start when it is the same behavior that is duplicated across the functions in the module, ie. a violation of the Don't Repeat Yourself (DRY) principle. DRY violations lead to code that is changed together in predictable patterns, which is both expensive and risky. DRY violations can be identified using CodeScene's X-Ray analysis to detect clusters of change coupled functions with high code similarity. Read More
Once you have identified the similarities across functions, look to extract and encapsulate the concept that varies into its own function(s). These shared abstractions can then be re-used, which minimizes the amount of duplication and simplifies change.

@leynos

leynos commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message in a code block that I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

Code Duplication

installer/tests/toolchain_steps/mod.rs:

What lead to degradation?

The module contains 4 functions with similar structure: then_error_includes_toolchain_name,then_error_mentions_install_failure,then_install_message_shown,then_no_install_message

Why does this problem occur?

Duplicated code often leads to code that's harder to change since the same logical change has to be done in multiple functions. More duplication gives lower code health.

How to fix it?

A certain degree of duplicated code might be acceptable. The problems start when it is the same behavior that is duplicated across the functions in the module, ie. a violation of the Don't Repeat Yourself (DRY) principle. DRY violations lead to code that is changed together in predictable patterns, which is both expensive and risky. DRY violations can be identified using CodeScene's X-Ray analysis to detect clusters of change coupled functions with high code similarity. Read More
Once you have identified the similarities across functions, look to extract and encapsulate the concept that varies into its own function(s). These shared abstractions can then be re-used, which minimizes the amount of duplication and simplifies change.

@leynos

leynos commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message in a code block that I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

Code Duplication

installer/tests/behaviour_cli/support_assertions.rs:

What lead to degradation?

The module contains 2 functions with similar structure: assert_experimental_lint_opt_in_message_is_shown,assert_unknown_lint_message_is_shown

Why does this problem occur?

Duplicated code often leads to code that's harder to change since the same logical change has to be done in multiple functions. More duplication gives lower code health.

How to fix it?

A certain degree of duplicated code might be acceptable. The problems start when it is the same behavior that is duplicated across the functions in the module, ie. a violation of the Don't Repeat Yourself (DRY) principle. DRY violations lead to code that is changed together in predictable patterns, which is both expensive and risky. DRY violations can be identified using CodeScene's X-Ray analysis to detect clusters of change coupled functions with high code similarity. Read More
Once you have identified the similarities across functions, look to extract and encapsulate the concept that varies into its own function(s). These shared abstractions can then be re-used, which minimizes the amount of duplication and simplifies change.

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@leynos
leynos force-pushed the harden-lint-config branch from 2c5cd42 to 9aa9e45 Compare August 21, 2026 15:00
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Your free Security trial is over. An organization admin can activate billing to continue.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@leynos

leynos commented Aug 27, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response. Ensure that this is validated against the current version of the codegraph.

If further refinement to address this finding would be deleterious, please supply a clear explanatory one to two paragraph markdown message in a code block that I can paste into the CodeScene web ui's diagnostic suppression function so this diagnostic can be silenced.

Overall Code Complexity

crates/module_must_have_inner_docs/src/driver/inner_attr.rs:

What lead to degradation?

This module has a mean cyclomatic complexity of 4.14 across 7 functions. The mean complexity threshold is 4

Why does this problem occur?

Overall Code Complexity is measured by the mean cyclomatic complexity across all functions in the file. The lower the number, the better.
Cyclomatic complexity is a function level metric that measures the number of logical branches (if-else, loops, etc.). Cyclomatic complexity is a rough complexity measure, but useful as a way of estimating the minimum number of unit tests you would need. As such, prefer functions with low cyclomatic complexity (2-3 branches).

How to fix it?

You address the overall cyclomatic complexity by a) modularizing the code, and b) abstract away the complexity. Let's look at some examples:
Modularizing the Code: Do an X-Ray and inspect the local hotspots. Are there any complex conditional expressions? If yes, then do a DECOMPOSE CONDITIONAL refactoring. Extract the conditional logic into a separate function and put a good name on that function. This clarifies the intent and makes the original function easier to read. Repeat until all complex conditional expressions have been simplified.

@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, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 300 files, and this pull request has 428

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b758d198b

ℹ️ 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".

Comment thread crates/whitaker_sarif/src/model/run.rs
Comment thread common/src/i18n/mod.rs
Comment thread installer/src/dirs.rs
@leynos

leynos commented Aug 28, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai assertions should not be used in given or when steps that return a result. The assertions should be performed in the then step.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@leynos Keep given and when steps that return Result fallible and free of assertions. Put assertions in then steps.


✏️ Learnings added
Learnt from: leynos
URL: https://github.com/leynos/whitaker/pull/346

Timestamp: 2026-08-28T14:01:04.275Z
Learning: In Whitaker Rust BDD tests, do not use assertions in `given` or `when` step functions that return `Result`. Use fallible commands and return errors from those steps. Perform assertions only in `then` steps.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

leynos and others added 21 commits August 28, 2026 16:37
Promote the root package's clippy policy to `[workspace.lints]` so every
member crate — including the rustc proxy shims and support crates — is
held to the same standard, and extend it:

- add `disallowed_methods` and `missing_assert_message` to the clippy
  set;
- forbid `unsafe_code` workspace-wide;
- add `[lints] workspace = true` to every member crate, removing the
  now-redundant local `expect_used`/`unwrap_used` and `unexpected_cfgs`
  tables;
- introduce `.rustfmt.toml` with the estate's unstable nightly
  formatting options;
- run workspace doctests (`cargo test --workspace --doc --all-features`)
  from the `test` target with warnings denied;
- request the `rust-analyzer` component in `rust-toolchain.toml`.

The tree is brought into compliance by the preparatory stack beneath
this branch; this commit records the policy itself.
Bring the tree toward compliance with the hardened `[workspace.lints]`
policy, fixing findings at source rather than suppressing them:

- apply the machine-applicable clippy fixes across the workspace
  (`const fn`, owned-string clones, `use_self`, import granularity,
  format-args interpolation);
- restructure panic-prone indexing in the decomposition-advice, LCOM4,
  clone-detection, and signal modules with iterator and `get`-based
  rewrites that preserve behaviour;
- replace the unsafe `EnvVarGuard`/`LocaleOverride` environment guards
  with scoped `temp_env`-backed helpers (`with_env_var`,
  `with_env_var_removed`, `with_locale`) and rework the UI runner and
  all call sites onto them, satisfying `unsafe_code = "forbid"`;
- declare the suite's Dylint entry point through a new
  `declare_dylint_register_entry!` macro in whitaker-common so the
  `#[unsafe(no_mangle)]` attribute expands from an external macro;
- replace the installer's `libc::geteuid()` root probe with the safe
  `rustix::process::geteuid()` and drop the now-unused libc dependency;
- document struct fields, `# Errors`, and `# Panics` contracts; rename
  shadowed bindings; add assertion messages; make non-test helpers
  fallible instead of panicking;
- scope the one sanctioned `#[expect(clippy::float_arithmetic)]` to the
  bumpy-road signal functions whose weights are user-configured floats;
- split `lint` into `lint-clippy` and `lint-whitaker` so the Whitaker
  suite lints the support crates in the gate and CI installs the
  pinned whitaker-installer;
- refresh the spelling exemptions for moved SARIF identifier lines and
  correct two non-oxendict spellings.
Run `cargo fmt --all` under the new `.rustfmt.toml` (imports granularity,
single-line functions, wrapped comments, formatted strings and doc
examples). No behavioural changes.
Rename the `-ise`/`-isation` identifiers, call sites, documentation and
Gherkin step text to the Oxford `-ize`/`-ization` forms the shared
spelling policy requires, rather than exempting each line:

- `normalise_*` -> `normalize_*`, `summarise_context*` ->
  `summarize_context*`, `localised_messages` -> `localized_messages`,
  and the matching test, fixture and step-function names;
- `capitalise_segment`, `pluralisation`, `deserialises_*`,
  `recognises_*`, `finalised`, `parametrised` and `synthesised`
  likewise;
- SARIF `Artifact`/`ArtifactLocation` -> `Artefact`/`ArtefactLocation`.
  The `artifactLocation` and `artifacts` property names are fixed by
  the OASIS SARIF 2.1.0 schema, so the fields pin their wire names with
  `serde(rename)` and the two literals remain exempt as serialized
  values;
- the en-GB diagnostic note in `no_expect_outside_tests` now reads
  "recognized", with the byte-exact `.stderr` fixtures updated in step
  so the localized message and its fallback agree.

Delete the unused deprecated `rasterise_signal` alias instead of
renaming it; the workspace treats these as internal APIs, so no
compatibility shim is needed.

Prune the 205 now-dead `typos.local.toml` ignore patterns left behind.
The 50 that remain cover genuinely external names only: Gaelic and
Welsh locale prose, `cargo_metadata::CompilerArtifact`, GitHub Actions
artifact actions, `act`'s `--artifact-server-path`, dylint UI fixture
sources, and the two SARIF wire-format properties.

Also repair the `#[path]` test declarations in
`module_must_have_inner_docs`, which resolved relative to `src/driver/`
after that module moved to `driver/mod.rs`, and adopt the shared
`allow_fixture_expansion_lints` attribute for single-line rstest
fixtures across the workspace.
Satisfy `self_named_module_files` for `install_flow`, `tests`, `toolchain`,
and `toolchain::tests::failure_mocks`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rename shadowed bindings, borrow needlessly-owned parameters, replace slice
indexing with slice patterns, drop the vestigial `Result` around prebuilt
installation, and extract wrapper-script assertion helpers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replace slice indexing with fallible lookups and slice patterns, rename
shadowed bindings, name wildcard match variants explicitly, elide a redundant
lifetime, inline format arguments, compare archive extensions case-insensitively,
and reshape the resolve-crates test case struct to drop its bool cluster.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bring the lint crates, the root crate, and the installer's directory
abstraction into compliance with the hardened policy:

- isolate `dylint_linting::impl_late_lint!` in a `mod declaration` per
  lint crate and re-export only the documented lint surface, so the
  macro's undocumentable ABI entry point and `get_lints` accessor carry
  one fulfilled, reasoned `#![expect(missing_docs)]` instead of the
  policy being disabled crate-wide;
- isolate `newt_hype::base_newtype!` likewise for the explicit `Clone`
  impl it emits on a `Copy` type;
- rename the `BaseDirs` trait methods to `home`/`executables`/
  `whitaker_data` so the mockall-generated struct no longer shares a
  uniform field postfix, fixing `struct_field_names` at source;
- replace the two `float_cmp` assertions with `to_bits()` comparisons,
  which is what "the configured value round-tripped unchanged" actually
  asserts;
- add the missing assertion messages in the root crate's harness tests.

Scope the Clippy gate to `--lib --bins --tests --benches` rather than
`--all-targets`. Every file under a lint crate's `examples/` directory
is a `fail_*`/`pass_*` Dylint UI fixture that deliberately contains the
anti-patterns the suite detects; a fixture proving `expect_used` fires
cannot itself forbid `expect_used`. They live in `examples/` rather than
`ui/` because `dylint_testing::Test::example` builds them with each
crate's dev-dependencies. `typecheck` still compiles them and the UI
harness still lints them.
Three test failures traced to the new formatting profile rather than to
any behavioural change:

- `cargo fmt --all` formats `examples/` because those files are Cargo
  targets, and `format_strings` split a long `reason = "..."` across
  lines. That shifted the diagnostics one line down, so the byte-exact
  `.stderr` expectations no longer matched. Fixtures under `ui/` were
  never affected because they are not targets. Add a `.rustfmt.toml`
  `ignore` list so the `examples/` fixtures are equally immune, and
  restore the reformatted files; they now differ from `main` only by the
  two deliberate spelling corrections.
- `cargo package -p whitaker-common` failed because the new
  `whitaker_test_macros` dev-dependency carried a version requirement
  while the crate is `publish = false`. Make the workspace entry
  path-only: Cargo strips versionless dev-dependencies when packaging.

Also clear the two findings the Whitaker suite raised against its own
sources, now that `make lint` runs it:

- move the `#[must_use]` attributes in `i18n/diagnostics.rs` back after
  their doc comments, where a mechanical `clippy --fix` pass had wedged
  them between the summary line and the rest of the comment
  (`function_attrs_follow_docs`);
- recover the poisoned lock in `env_test_guard` with
  `PoisonError::into_inner` instead of panicking
  (`no_unwrap_or_else_panic`). The mutex guards `()`, so a poisoned lock
  carries no corrupted state -- only the record that an earlier test
  panicked while holding the serialization token.
`format_strings = true` broke a long literal across lines *inside* an
escape sequence: the backslash of `\n` became the end-of-line
continuation, leaving the `n` as literal text on the next line. The
assertion in the example-harness UI test was then searching for
`fixture-localnfingerprint=...` and failing.

This is content corruption rather than reformatting, and it is silent --
the code still compiles and only a test comparing exact output caught
it. Rewrite the literal with `concat!()`, which `AGENTS.md` already
prescribes over backslash-escaped newlines and which the formatter
cannot split mid-escape.
`make lint` now runs the Whitaker suite over the workspace's own support
crates, and this clears what it found there:

- `module_must_have_inner_docs`: give every `mod tests`/`mod unix` an
  explanatory `//!` opening line;
- `no_expect_outside_tests`: fixtures and helpers are not tests, so make
  them fallible and let the `#[test]`/`#[rstest]` body do the
  unwrapping. Two helpers became macros instead -- `source_span!`
  because it is used inside `#[case(...)]` where a `Result` cannot be
  propagated, and `utf8_path!` so the fallible conversion inlines into
  each test body;
- `no_unwrap_or_else_panic`: propagate errors rather than panicking in
  the closure, converting the enclosing rstest-bdd steps to return
  `Result<(), String>`;
- `no_std_fs_operations`: add the `i18n_packaging` integration-test
  crate to `dylint.toml`. That test shells out to `cargo package` and
  walks `$CARGO_TARGET_DIR`, so it is ambient by construction, and
  in-source suppression provably does not work for this lint. Note that
  integration-test targets compile as their own crate named after the
  file, so the existing `whitaker_common` entry did not cover it;
- `module_max_lines`: extract `workspace.rs`'s tests to
  `workspace_tests.rs` (440 lines to 209 + 231);
- `bumpy_road_function`: extract `attempt_repository_install`, then
  group its six parameters into a documented `RepositoryInstallRequest`
  so the extraction does not simply trade one denied lint for
  `too_many_arguments`.

Also rename two `let entry = entry?` rebinds and hoist an import above
the statements that the fixture conversions introduced ahead of it.
`make lint` now passes end to end: rustdoc, Clippy, and the Whitaker
suite over the workspace's own support crates.

- `no_expect_outside_tests`: convert the installer's fixtures and test
  helpers to return `Result`, with the `#[test]`/`#[rstest]` body doing
  the unwrapping. rstest fixtures are consumed as
  `#[from(fixture)] fixture_res: Result<..>` so the conversion does not
  trade the lint for `shadow_reuse` on a `let x = x?` rebind.
- `no_unwrap_or_else_panic`: propagate rather than panic in the closure.
- `module_max_lines`: split `list`, `downloader`, `workspace`,
  `dependency_binary_helpers` and `deps::tests` into sibling modules,
  each keeping an explanatory `//!` opening line.
- `bumpy_road_function`: extract the complexity clusters, grouping
  parameters into named structs where an extraction would otherwise
  exceed the four-argument budget.
- `no_std_fs_operations`: add the integration-test crates that stage
  fixtures ambiently to `dylint.toml`. In-source suppression does not
  work for this lint, and these targets compile as their own crate named
  after the file, so they are not covered by the package-level entries.
`make test` now runs the workspace doctests, which surfaced two things.

Doctests compile as their own crate and do not inherit the lib's
`#![cfg_attr(feature = "dylint-driver", feature(rustc_private))]`, so
under `--all-features` every Dylint driver crate fails to link
`rustc_driver`. Their examples are exercised by the unit and UI suites
instead, so exclude them, mirroring the existing `nextest` exclusions.

Also repair two doc examples in `installer/src/dirs.rs` left stale by
the `BaseDirs` method rename. `leta rename` updates code references but
not doc comments, and `cargo doc` only validates intra-doc links, so
nothing caught these until the examples were actually compiled -- which
is the point of adding the gate.
`then_node_has_no_neighbours` and `then_neighbours_of_node_are_sorted`
each repeated the same `neighbours_of` lookup and out-of-bounds
conversion before their differing assertion, which CodeScene flagged as
duplication.

Add `with_neighbours_of_node` alongside `with_report` and layer it on
top, so the successful-build handling stays in one place and each step
is left with only its own assertion. Behaviour is unchanged: the step
strings, the bounds-error text, the assertion messages, and the
`is_sorted_by_key` check are all preserved verbatim.
CodeScene flagged four runs of adjacent bare assertions in the CLI
default tests as large assertion blocks. Each was also silent about
which field had drifted: a failure reported only the line number.

Add `assert_default_conditions`, which takes `(name, condition)` pairs
and names the offending field in the panic message, and express each
group as a table of named pure boolean queries. The checks themselves
are unchanged, including the `verbosity == 0` comparison, which becomes
a boolean rather than an `assert_eq!` so it fits the same table.

No `PartialEq`/`Eq` derives were added and the production CLI types are
untouched; the tests still read each field individually.
`then_pkg_url_present`, `then_bin_dir_present` and `then_default_pkg_fmt`
each repeated the same fetch-key-and-compare shape, which CodeScene
flagged as duplication. Add `assert_binstall_value_equals` beside
`table_str` and reduce each step to a single call.

The helper reports a mismatch by returning `Err` rather than asserting.
These steps return `Result`, so an `assert_eq!` here trips
`clippy::panic_in_result_fn`, and returning the message matches how
every other step in the file reports failure. The message text is
unchanged, so existing failures read exactly as before.

`then_windows_override_pkg_fmt` is left alone: it reads through the
`overrides` table and carries its own error strings, so it does not fit
this helper.
Extract shared output assertions so related BDD steps retain their
existing conditions while avoiding duplicated control flow.
Return diagnostic failures from the fallible integration test so the test
keeps its detailed failure output without panicking.
Build the documented filename from the public platform prefix and extension
helpers so the example works on Windows, macOS, and Linux.
Resolve the target branch's lockfile conflict from the manifest and preserve
the current compatible dependency graph.
@leynos
leynos force-pushed the harden-lint-config branch from 9b758d1 to afb1e4a Compare August 28, 2026 14:49
codescene-access[bot]

This comment was marked as outdated.

@codescene-access codescene-access 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.

No quality gates enabled for this code.

@leynos

leynos commented Aug 30, 2026

Copy link
Copy Markdown
Owner Author

Superseded by the eight-PR stack #362 → #372; see the updated description.

@leynos leynos closed this Aug 30, 2026
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