Skip to content

Added cli#219

Open
niekdomi wants to merge 4 commits intoblopker:mainfrom
niekdomi:cli
Open

Added cli#219
niekdomi wants to merge 4 commits intoblopker:mainfrom
niekdomi:cli

Conversation

@niekdomi
Copy link
Contributor

@niekdomi niekdomi commented Feb 25, 2026

Closes #39

Adds a lint subcommand for spell-checking files from the CLI, making it suitable for CI pipelines since it exits with a non-zero status code when spelling errors are found.

Flags:

  • -u / --unique — report each misspelled word only once, ignoring duplicates across files
  • -s / --suggest — show spelling suggestions for each misspelled word

Auto-fix was intentionally omitted as it could easily lead to unexpected changes in code.

Default --unique --suggest
default unique suggest

Note: if #217 is planned to be merged, it should be merged before this PR.

Replaces the manual ansi escape approach with owo-colors, which handles
NO_COLOR and windows automatically. The code is also way better in
general than my previous approach...
@niekdomi niekdomi marked this pull request as ready for review March 4, 2026 17:56
Copilot AI review requested due to automatic review settings March 4, 2026 17:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a lint subcommand to the codebook-lsp binary to spell-check files from the command line (intended for CI usage via non-zero exit codes).

Changes:

  • Introduces lint CLI subcommand with --unique and --suggest flags.
  • Implements file/glob/directory expansion and terminal-colored diagnostics output for lint results.
  • Adds new dependencies (glob, walkdir, owo-colors) to support path resolution and output formatting.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
crates/codebook-lsp/src/main.rs Adds lint subcommand wiring and adjusts default logging behavior for lint vs LSP.
crates/codebook-lsp/src/lint.rs Implements CLI lint execution: config loading, path resolution, spell-checking, and output formatting.
crates/codebook-lsp/Cargo.toml Adds dependencies required by the new lint module.
Cargo.toml Adds owo-colors to workspace dependencies.
Cargo.lock Locks new transitive dependencies introduced by owo-colors/CLI additions.

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.

Make into a CLI tool

2 participants