Skip to content

Add CLI diagnostics checker#46

Merged
ViTeXFTW merged 2 commits into
devfrom
feat-cli
Jul 17, 2026
Merged

Add CLI diagnostics checker#46
ViTeXFTW merged 2 commits into
devfrom
feat-cli

Conversation

@ViTeXFTW

Copy link
Copy Markdown
Owner

Summary

  • add zerosyntax-lsp check for one-shot diagnostics from files, directories, or stdin
  • share workspace, BIG archive, W3D, and string-table scanning between the CLI and LSP backend
  • support stable human/JSON output, severity-based exit codes, base roots, and cross-file indexing
  • document CLI usage and output contracts

Why

A batch diagnostics interface enables LLM edit/check loops, CI and pre-commit validation, mod build gates, and reproducible checks without launching an editor or speaking LSP.

Validation

  • cargo test --locked
  • cargo fmt --all --check
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • python crates/server/tests/e2e.py target/debug/zerosyntax-lsp.exe

The CLI integration suite runs the real binary and covers stdin, JSON/human output, Unicode positions, failure thresholds, directory deduplication, cross-file resolution, directory and .big base roots, and invalid usage.

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds one-shot command-line diagnostics to zerosyntax-lsp. The main changes are:

  • New zerosyntax-lsp check subcommand for files, directories, and stdin.
  • Shared scanning for workspace INIs, BIG archives, W3D assets, and string tables.
  • Human and JSON diagnostic output with severity-based exit codes.
  • Documentation for CLI usage, output shape, and exit-code behavior.

Confidence Score: 5/5

Safe to merge with minimal risk.

The changed paths are cohesive and covered by focused CLI integration tests for the main workflows.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex executed the requested contract verification for the pull request.
  • T-Rex confirmed that local artifact references were not uploaded with the verification results.
  • T-Rex documented the missing artifacts and prepared a note for reviewers to upload or supply references.

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
crates/server/src/cli.rs Implements the diagnostics CLI, including target/base scanning, stdin support, output formats, and failure thresholds.
crates/server/src/scan.rs Extracts shared filesystem, BIG archive, W3D, and string-table scanning with checked variants for CLI use.
crates/server/src/main.rs Routes non-LSP invocations into the CLI while preserving default and --stdio LSP startup.
crates/server/src/backend.rs Refactors backend scanning to use the shared scanner while keeping workspace indexing and virtual BIG file behavior.
crates/server/tests/cli.rs Adds integration coverage for stdin, JSON/human output, thresholds, deduplication, base roots, and usage failures.
docs/language-server.md Documents command-line diagnostics usage, JSON fields, severity thresholds, and exit codes.

Reviews (2): Last reviewed commit: "accept stdio transport flag" | Re-trigger Greptile

@ViTeXFTW

Copy link
Copy Markdown
Owner Author

@greptileai

@ViTeXFTW
ViTeXFTW marked this pull request as ready for review July 17, 2026 07:43
@ViTeXFTW
ViTeXFTW merged commit 59f32c0 into dev Jul 17, 2026
5 checks passed
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