Open
Conversation
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...
Contributor
There was a problem hiding this comment.
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
lintCLI subcommand with--uniqueand--suggestflags. - 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #39
Adds a
lintsubcommand 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 wordAuto-fix was intentionally omitted as it could easily lead to unexpected changes in code.
--unique--suggestNote: if #217 is planned to be merged, it should be merged before this PR.