Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR successfully decouples the CLI functionality from the library code, allowing sqlant to be used as a library without requiring the clap dependency. The changes move the cli module from being public in lib.rs to being a private module in main.rs, and make clap an optional dependency controlled by a feature flag.
Key Changes:
- Moved CLI module from
lib.rstomain.rsand madeclapan optional dependency - Configured Cargo to only build the binary when the "cli" feature is enabled
- Added CI test to verify library usage without clap dependency
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main.rs | Declares cli module locally and updates function call from sqlant::cli::parse() to cli::parse() |
| src/lib.rs | Removes public cli module declaration, keeping only core library modules |
| Cargo.toml | Makes clap optional via "cli" feature, adds binary configuration with required features, includes "cli" in default features |
| .github/workflows/ci.yml | Adds comprehensive test job to verify library can be used without clap dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/ci.yml
Outdated
|
|
||
| # Create a simple lib.rs that uses sqlant | ||
| cat > src/lib.rs << 'EOF' | ||
| use sqlant::{GeneratorType, get_generator}; |
There was a problem hiding this comment.
[nitpick] The imported get_generator function is not used in the test code. Consider removing it from the imports to keep the test minimal and clear.
Suggested change
| use sqlant::{GeneratorType, get_generator}; | |
| use sqlant::GeneratorType; |
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.
Makes it possible to use sqlant as library without clap dependency