-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: remove standalone validate CLI command #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1b3d607 to
4adce12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the codebase by removing the standalone validate command from the CLI interface while preserving internal validation functionality for use by other commands like run. The change simplifies the CLI surface area by eliminating a redundant command that duplicated validation logic already present in the execution flow.
Key changes:
- Removed the validate command implementation and associated test suite
- Cleaned up CLI command registration and type definitions
- Updated documentation to reflect the removed command
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
test/contract/validate-command.test.ts |
Removed comprehensive test suite for the validate command |
src/types/cli.ts |
Removed ValidateCommandArgs interface definition |
src/cli/index.ts |
Removed validate command registration and import |
src/cli/commands/validate.ts |
Removed entire validate command implementation (~683 lines) |
README.md |
Removed validation command documentation section |
ARCHITECTURE.md |
Removed validation command from removal candidates section |
4adce12 to
b1fd1af
Compare
b1fd1af to
ddc4538
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
ddc4538 to
02b8b0e
Compare
02b8b0e to
1ef4dc4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
1ef4dc4 to
90356d9
Compare
90356d9 to
620e93f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
620e93f to
1a5c916
Compare
1a5c916 to
3d611b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
| // (though we can't be too strict due to warmup, process startup, etc) | ||
| expect(duration1, 'to be less than', duration2); | ||
| // Allow for 50% variance to account for system overhead and variability | ||
| expect(duration1, 'to be less than', duration2 * 1.5); |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The magic number 1.5 should be extracted as a named constant like TIMING_VARIANCE_TOLERANCE to improve code readability and maintainability.
| readonly exclude: string[]; | ||
| /** Default number of iterations per task */ | ||
| readonly iterations: number; | ||
| /** How to limit benchmark execution: 'time', 'iterations', 'any', or 'all' */ |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The union type values are reordered alphabetically which is good, but the comment should also reflect this order for consistency: 'all', 'any', 'iterations', or 'time'.
| /** How to limit benchmark execution: 'time', 'iterations', 'any', or 'all' */ | |
| /** How to limit benchmark execution: 'all', 'any', 'iterations', or 'time' */ |
| readonly i?: number; | ||
| /** Number of iterations */ | ||
| readonly iterations?: number; | ||
| /** How to limit benchmark execution */ |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment is less descriptive than the corresponding comment in core.ts. For consistency, it should include the specific options: 'How to limit benchmark execution: 'all', 'any', 'iterations', or 'time''.
| /** How to limit benchmark execution */ | |
| /** How to limit benchmark execution: 'all', 'any', 'iterations', or 'time' */ |
| // Both must be met - tinybench default behavior | ||
| effectiveTime = Math.min(config.time || 1000, 2000); | ||
| effectiveIterations = 1; // Minimal iterations so time is the limiting factor | ||
| break; | ||
|
|
||
| case 'iterations': | ||
| // Iterations is the limit, use minimal time | ||
| effectiveTime = 1; | ||
| effectiveIterations = config.iterations; | ||
| break; |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The magic numbers 1000 and 2000 should be extracted as named constants like DEFAULT_TIME_MS and MAX_TIME_MS to improve code maintainability and make the logic clearer.
5c137e0 to
27bfd5d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
| } | ||
|
|
||
| // Always write to stdout when no output path is specified | ||
| // The quiet flag only affects progress messages (stderr), not data output |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should clarify that this behavior only applies when no output path is specified, since the function name and context suggest this is specifically for stdout output.
| // The quiet flag only affects progress messages (stderr), not data output | |
| // When no output path is specified (i.e., writing to stdout), the quiet flag only affects progress messages (stderr), not CSV data output |
- Remove validate command implementation and tests - Remove command registration from CLI - Remove ValidateCommandArgs interface - Update documentation (README.md and ARCHITECTURE.md) Internal validation methods (engine.validate, loader.validate, config.validate) remain intact for use by other commands like run. # Conflicts: # README.md
# Conflicts: # test/integration/quiet-mode.test.ts
27bfd5d to
d183d30
Compare
Internal validation methods (engine.validate, loader.validate, config.validate)
remain intact for use by other commands like run.