feat: add module validation helpers and --list-modules flag#66
Open
dev-nana27 wants to merge 1 commit into
Open
feat: add module validation helpers and --list-modules flag#66dev-nana27 wants to merge 1 commit into
dev-nana27 wants to merge 1 commit into
Conversation
- Add get_module_names() returning sorted valid module names - Add resolve_modules() for parsing 'all' or comma-separated module args with optional whitespace around commas, returning (selected, unknown) - Add list_modules_str() for formatted table of all modules - Add --list-modules flag with detailed module listing (table format) - Keep --list as a hidden alias for backward compatibility - Validate --module argument via resolve_modules() and show valid module names on error - All three helpers are unit-testable (no stdout/I-O side effects)
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.
Summary
Adds three new unit-testable helper functions for module validation and a
--list-modulesCLI flag tobuild.py.New helper functions (no I/O side effects → easily unit-testable):
get_module_names()→ returns sortedlist[str]of all valid module namesresolve_modules(module_arg: str)→ parses the-m/--moduleargument ("all" or comma-separated with optional spaces), returns(selected_modules, unknown_names)list_modules_str()→ returns a formatted table string of all modules with name, language, directory, and build commandCLI changes:
--list-modules: new flag to print a formatted table of all modules with details (name, language, directory, build command) and exit--list: kept as a hidden alias for backward compatibility-m/--modulevalidation: unknown module names now print an error with the full list of valid module names-m "backend , frontend")Example: