Summary
Add a --check mode that detects files which mdtablefix would change without modifying them.
In normal --check output, emit a diff for each changed input file.
Add a --concise flag for --check mode. This flag must list only the changed filenames.
Rationale
Repositories need a check-only formatting gate that reports formatting drift without changing tracked files.
A diff enables users to diagnose the required formatting changes. Filename-only output enables concise CI logs.
Required changes
- Add a
--check command-line option.
- In
--check mode, process every input file without modifying any input file.
- Return exit status zero when no input file requires formatting changes.
- Return a non-zero exit status when any input file requires formatting changes.
- In normal
--check mode, emit a readable diff for every input file that requires changes.
- Add a
--concise command-line option.
- When
--check --concise is used, list only the filenames of input files that require changes.
- Define the interaction of
--concise without --check, including either rejection or a documented behaviour.
- Preserve existing formatting and in-place formatting behaviour outside
--check mode.
Affected areas
- Command-line argument parsing.
- Formatter execution and file-writing paths.
- Diff rendering.
- User documentation and command help.
- Automated tests.
Acceptance criteria
Backlinks
Summary
Add a
--checkmode that detects files whichmdtablefixwould change without modifying them.In normal
--checkoutput, emit a diff for each changed input file.Add a
--conciseflag for--checkmode. This flag must list only the changed filenames.Rationale
Repositories need a check-only formatting gate that reports formatting drift without changing tracked files.
A diff enables users to diagnose the required formatting changes. Filename-only output enables concise CI logs.
Required changes
--checkcommand-line option.--checkmode, process every input file without modifying any input file.--checkmode, emit a readable diff for every input file that requires changes.--concisecommand-line option.--check --conciseis used, list only the filenames of input files that require changes.--concisewithout--check, including either rejection or a documented behaviour.--checkmode.Affected areas
Acceptance criteria
mdtablefix --check clean.mdreturns exit status zero and does not modifyclean.md.mdtablefix --check unformatted.mdreturns a non-zero exit status and does not modifyunformatted.md.mdtablefix --check unformatted.mdemits a diff that identifies the required changes.mdtablefix --checkprocesses all supplied input files and reports every changed file before it exits non-zero.mdtablefix --check --concisereturns a non-zero exit status for changed input and lists only changed filenames.--conciseoutput contains no diff content.--checkand--concise.Backlinks
@leynos