Skip to content

feat: add module validation helpers and --list-modules flag#66

Open
dev-nana27 wants to merge 1 commit into
cuentaprueba244w-dotcom:mainfrom
dev-nana27:main
Open

feat: add module validation helpers and --list-modules flag#66
dev-nana27 wants to merge 1 commit into
cuentaprueba244w-dotcom:mainfrom
dev-nana27:main

Conversation

@dev-nana27

Copy link
Copy Markdown

Summary

Adds three new unit-testable helper functions for module validation and a --list-modules CLI flag to build.py.

New helper functions (no I/O side effects → easily unit-testable):

  • get_module_names() → returns sorted list[str] of all valid module names
  • resolve_modules(module_arg: str) → parses the -m/--module argument ("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 command

CLI 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/--module validation: unknown module names now print an error with the full list of valid module names
  • Commas with optional whitespace are supported (e.g. -m "backend , frontend")

Example:

python3 build.py --list-modules
python3 build.py -m backend,frontend
python3 build.py -m bogus
# → ✗ Unknown modules: bogus
#   Valid modules: backend, compliance, engine, ...

- 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant