Add generate-schema command for JSON schema generation#63
Merged
Conversation
- Implement GenerateSchemaCommand class to generate JSON schema for available structures - Add command line arguments for structures path and output file - Scan both contribs directory and custom structures path - Generate JSON schema with PluginList enum containing all available structures - Support output to file or stdout - Add documentation for the generate-schema command
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
=======================================
Coverage 60.20% 60.20%
=======================================
Files 21 21
Lines 980 980
Branches 141 141
=======================================
Hits 590 590
Misses 365 365
Partials 25 25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add generate-schema command to subcommands list in both English and Spanish READMEs - Add comprehensive documentation section for generate-schema command with usage examples - Include command options and use cases for the new functionality - Fix markdown linting issue with missing language specification for code blocks - Provide Spanish translation of all new documentation content
- Fix comprehensive mock setup for os.path functions to avoid NoneType errors - Implement proper mock_join_side_effect to handle path construction correctly - Update mock_relpath_side_effect to return proper file paths with extensions - Correct mock_exists_side_effect logic for file output directory creation tests - Ensure all tests properly simulate filesystem behavior with complete mocking - All 8 generate_schema tests now passing successfully Test coverage includes: - Command initialization and argument parsing - stdout output with multiple structures and subdirectories - file output with directory creation - custom structures path handling - nonexistent path graceful handling - empty directory handling
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.
Description
This PR adds a new
generate-schemacommand that generates JSON schema definitions for available structure templates.Features
struct generate-schemacommandUsage
Implementation Details
Files Changed
struct_module/commands/generate_schema.py- New command implementationstruct_module/main.py- Updated to register the new commanddocs/generate-schema.md- Added documentation for the new commandThis enhancement makes it easier for users and tools to discover available structure templates programmatically.