Conversation
Signed-off-by: devjow <me@devjow.com>
📝 WalkthroughWalkthroughIntroduces a CLI binary for gts-validator alongside documentation and tests. Adds clap-based argument parsing, filesystem scanning entry point, and output formatting. Includes CI smoke test for build validation and integration tests covering help, JSON output, vendor enforcement, strict mode, and default path resolution. Changes
Sequence DiagramsequenceDiagram
participant User as CLI User
participant Clap as Clap Parser
participant Main as main.rs
participant Lib as gts_validator Lib
participant Output as Output Module
participant Exit as Process Exit
User->>Clap: Provide CLI arguments
Clap->>Main: Parsed Cli struct
Main->>Main: Build FsSourceConfig &<br/>ValidationConfig
Main->>Lib: validate_fs(configs)
Lib->>Lib: Scan filesystem &<br/>validate identifiers
Lib->>Main: Return ValidationReport
Main->>Output: Format report (JSON or<br/>human-readable)
Output->>Main: Formatted string
Main->>User: Print output
Main->>Exit: Exit with code<br/>(SUCCESS or FAILURE)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
gts-validator/src/main.rs (1)
80-83: Improve empty-path error context.The current error is actionable but terse; including searched defaults improves CLI UX/debuggability.
💡 Suggested tweak
if paths.is_empty() { - eprintln!("No existing paths to scan. Provide paths explicitly."); + eprintln!( + "No existing paths to scan. Searched defaults: {}. Provide paths explicitly.", + DEFAULT_SCAN_DIRS.join(", ") + ); return ExitCode::FAILURE; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@gts-validator/src/main.rs` around lines 80 - 83, Update the empty-path error to include the default search paths attempted so users see what was checked; in the block where you check paths.is_empty() (the variable paths in main or the CLI entrypoint) change the eprintln! to print a message that lists the default paths variable or function (e.g., DEFAULT_PATHS or the result of default_search_paths()) along with the existing hint to provide explicit paths, then return ExitCode::FAILURE as before.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@gts-validator/src/main.rs`:
- Around line 80-83: Update the empty-path error to include the default search
paths attempted so users see what was checked; in the block where you check
paths.is_empty() (the variable paths in main or the CLI entrypoint) change the
eprintln! to print a message that lists the default paths variable or function
(e.g., DEFAULT_PATHS or the result of default_search_paths()) along with the
existing hint to provide explicit paths, then return ExitCode::FAILURE as
before.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
.github/workflows/ci.ymlgts-validator/Cargo.tomlgts-validator/README.mdgts-validator/src/main.rsgts-validator/tests/cli_tests.rs
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests