Skip to content

feat: add format subcommand for CLI formatting#127

Merged
barrettruth merged 1 commit intomainfrom
feat/format-subcommand
Mar 25, 2026
Merged

feat: add format subcommand for CLI formatting#127
barrettruth merged 1 commit intomainfrom
feat/format-subcommand

Conversation

@barrettruth
Copy link
Copy Markdown
Owner

Problem

The formatter is only accessible via LSP textDocument/formatting, requiring a running editor. There's no way to format vimdoc files from the CLI for CI pipelines, pre-commit hooks, or batch operations.

Solution

Add a format subcommand mirroring the existing check pattern. vimdoc-language-server format doc/ formats files in-place; --check exits 1 if any file would change (for CI). Directories are globbed for *.txt files. Global --line-width, --reflow, and --normalize-spacing flags apply. Both format and check are now documented in the README under a new CLI section.

Problem: the formatter is only available via LSP `textDocument/formatting`,
which requires a running editor. Users cannot format vimdoc files from the
CLI for CI pipelines, pre-commit hooks, or batch operations.

Solution: add a `format` subcommand that formats files in-place, with a
`--check` flag that exits 1 if any file would change (for CI). Directories
are globbed for `*.txt` files. Global `--line-width`, `--reflow`, and
`--normalize-spacing` flags apply. Document both `format` and `check`
subcommands in the README.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vimdoc-language-server Ready Ready Preview, Comment Mar 25, 2026 2:49pm

@barrettruth barrettruth merged commit 6a6ecc8 into main Mar 25, 2026
10 checks passed
@barrettruth barrettruth deleted the feat/format-subcommand branch March 25, 2026 14:56
@barrettruth barrettruth mentioned this pull request Mar 25, 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