Skip to content

lint --fix: full-block-span removal for block-spanning Tier A fixes (empty-block, unreachable-branch) #172

Description

@dean0x

Problem

Current --fix planner (crates/mds-core/src/lint/fix.rs::diag_to_edit) removes only the directive line; for block-spanning rules this orphans the @end, so the reverify gate refuses every such fix (fail-closed — correct safety behavior, no user harm).

Solution

To make Tier A real for these rules, the planner needs a block-span edit:

  • Compute the full span: directive-line start through the matching @end line (inclusive)
  • Remove the entire block
  • Add tests: fixed file must build byte-identically

Documented as best-effort in spec §8 footnote.

Discovered

Scenario QA on #61 / PR #171.

Labels

enhancement, cli (if those labels exist on the repo)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions