Skip to content

fix(cli): fail on remaining diagnostics after --fix - #202

Merged
luojiyin1987 merged 2 commits into
masterfrom
fix/fail-on-remaining-diagnostics
Oct 14, 2026
Merged

luojiyin1987 merged 2 commits into
masterfrom
fix/fail-on-remaining-diagnostics

Conversation

@luojiyin1987

@luojiyin1987 luojiyin1987 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Keep Core's remainingSummary in BatchLintItem.
Use the remaining error and warning counts to decide the --fix exit code.
Check every file result, including results excluded from writeback.
Fail if a file fix result lacks remaining counts.
Keep stdin output as Markdown only.
Print each file's remaining error and warning counts to stderr.
Print the same summary to stderr for stdin input.

Why

--fix could return exit code 0 while errors or unsuppressed warnings remained.
The previous check only handled rule execution errors.

Verification

  • Before this change, four real CLI cases returned 0 when they should return 1.
  • npm run lint passed.
  • npm test -- --runInBand passed: 27 suites and 238 tests.
  • git diff --cached --check passed.
  • Tests cover file and stdin input, warning suppression, successful fixes, and rule failures.
  • Real CLI tests check the remaining-count message in stderr.

Redactions

No sensitive data was included.

@luojiyin1987
luojiyin1987 merged commit 2f06d3d into master Oct 14, 2026
5 checks passed
@luojiyin1987
luojiyin1987 deleted the fix/fail-on-remaining-diagnostics branch October 14, 2026 16:39
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