Skip to content

fix(fmt): diff limitations_tests.rs limitation_of_kind call needs formatting (#2846) #2848

Closed

Description

@EffortlessSteven

Problem

PR #2846 (fix(diff): retain typed combined and conflict limitations) fails CI because cargo fmt --check detects a formatting difference in crates/ripr/src/analysis/diff/limitations_tests.rs.

Fix

The limitation_of_kind call fits on one line within the 100-char budget:

-    let limitation = limitation_of_kind(
-        &parsed,
-        AnalysisLimitationKind::UnresolvedConflictMarkers,
-    );
+    let limitation = limitation_of_kind(&parsed, AnalysisLimitationKind::UnresolvedConflictMarkers);

Run cargo fmt on the codex/diff-parser-limitations-2828 branch.

CI log evidence

-    );
+    let limitation = limitation_of_kind(&parsed, AnalysisLimitationKind::UnresolvedConflictMarkers);
     assert_eq!(limitation.path.as_deref(), Some("src/lib.rs"));
##[error]Process completed with exit code 1.

Activity

  1. coderabbitai commented on Aug 1, 2026

    @coderabbitai
    🔗 Related PRs

    #2381 - test(lsp): complete boundary-gap saved-workspace fixture isolation (#2371) [merged]
    #2384 - test(cli): require concrete fixture repository HEADs (#2383) [merged]
    #2431 - fix(output): emit diff JSON changed-file paths with forward slashes (#2429) [merged]
    #2467 - docs(cli): fix crate README Quick Start examples that failed verbatim [merged]
    #2836 - fix(test): use typed argv instead of Bash display parsing for nav replay (#2816) [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. EffortlessSteven commented on Aug 1, 2026

    @EffortlessSteven
    MemberAuthor

    Updated: the fmt fix (#2850) was merged but #2846 still fails

    The fmt fix resolved the formatting issue, but CI then revealed a deeper problem: compile error — ParsedDiff does not have a limitations field that the test file references.

    The fix requires adding the limitations field to ParsedDiff in the production code (crates/ripr/src/analysis/diff/mod.rs), not just formatting.

  3. EffortlessSteven commented on Aug 1, 2026

    @EffortlessSteven
    MemberAuthor

    Precise diagnosis (2026-08-01)

    The compile error is clear:

    ParsedDiff at crates/ripr/src/analysis/diff/parse.rs:148 does not have a limitations field.

    Current struct:

    pub(crate) struct ParsedDiff {
        pub(crate) changed_files: Vec<ChangedFile>,
        pub(crate) deleted_file_count: usize,
        pub(crate) submodule_file_count: usize,
        pub(crate) renamed_file_count: usize,
        pub(crate) pure_rename_file_count: usize,
        pub(crate) pure_rename_paths: Vec<PathBuf>,
    }

    The test file limitations_tests.rs references parsed.limitations which requires:

    1. Adding pub(crate) limitations: Vec<AnalysisLimitation> to ParsedDiff
    2. Populating it in parse_unified_diff_with_metadata when combined/conflict diffs are detected
    3. This is the core feature implementation, not just a test fix

    This is the maintainer/Codex agent's feature work — the test was written before the production code was complete. Cannot be fixed without implementing the full combined-diff limitation detection.

  4. EffortlessSteven commented on Aug 1, 2026

    @EffortlessSteven
    MemberAuthor

    Correction: this is not a formatting problem, and the fix described here is not sufficient.

    The cargo fmt fix already landed on codex/diff-parser-limitations-2828 as commit e7b3aaca ("fix(fmt): format limitations_tests.rs limitation_of_kind calls"). At that exact tip, CI still fails — but on compilation, not formatting:

    error[E0609]: no field `limitations` on type `&ParsedDiff`
      --> crates/ripr/src/analysis/diff/limitations_tests.rs:12:80
       = note: available fields are: `changed_files`, `deleted_file_count`, `submodule_file_count`,
               `renamed_file_count`, `pure_rename_file_count`, `pure_rename_paths`
    error: could not compile `ripr` (lib test) due to 5 previous errors
    

    Root cause

    PR #2846 is tests only. Its full diff against origin/main is:

     crates/ripr/src/analysis/diff/limitations_tests.rs | 214 +++++++++++++++++++++
     crates/ripr/src/analysis/diff/mod.rs               |   3 +
     2 files changed, 217 insertions(+)
    

    Zero production lines. The tests assert against parsed.limitations and limitation_of_kind(..), but ParsedDiff (crates/ripr/src/analysis/diff/parse.rs:148 on origin/main) has no limitations field. The branch is a red-state TDD commit: the production half of #2828 — retaining typed combined-hunk and conflict-marker limitations on the parsed diff — was never written.

    The branch is also currently behind origin/main and needs a rebase.

    Disposition

    The remaining work belongs to #2828, not to a separate formatting issue. Suggest closing this as superseded and tracking the production change on #2828.

  5. EffortlessSteven commented on Aug 2, 2026

    @EffortlessSteven
    MemberAuthor

    Obsolete diagnosis. The parser claim is now implemented and merged through #2861 (d2a93e7bbb91ea90e46e38b92bef4e9cd281e9cb), including explicit combined quarantine, paired-boundary recovery, configurable conflict widths, context markers, and removal experiments. Close this issue as superseded by the merged implementation.

  6. EffortlessSteven commented on Aug 2, 2026

    @EffortlessSteven
    MemberAuthor

    Follow-up (2026-08-02)

    RESOLVED — closed as part of #2828/#2861 landing. The fmt fix I provided (#2850) was merged into the branch, and the full implementation shipped. The compile error (ParsedDiff.limitations missing) was fixed by the maintainer.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions