Refactor to package structure and enhance CLI with comprehensive features #2
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
This PR significantly enhances hier-config-cli by converting it to a proper Python package structure, adding comprehensive documentation, improving code quality tooling, and expanding CLI capabilities with new features like multiple output formats, verbose logging, and better error handling.
Key Changes
Project Structure & Packaging
src/hier_config_cli.py) to proper package structure (src/hier_config_cli/)__init__.pywith version and CLI exportspy.typedmarker file for PEP 561 type hint compliancepyproject.tomlto usehier_config_cli:cliCLI Enhancements
--formatoption supporting text, JSON, and YAML output formats--output/-oflag to save output to fileslist-platformscommand to display all available platformsversioncommand to show tool version-v(INFO) and-vv(DEBUG) flagsprocess_configs()functioncisco_style_text()for all platforms)Code Quality & Development
buildjob totestfor clarityDocumentation
Dependencies & Configuration
pyproject.tomlwith:.editorconfigfor consistent editor settings across platformsBreaking Changes
hier_config_cli:clihier_config_cliinstead ofhier_config_cli.pyNotable Implementation Details
process_configs()function eliminates code duplication across remediation, rollback, and future commandsTesting
All changes maintain backward compatibility for the core functionality while improving the overall quality and usability of the tool. The enhanced test suite includes error handling, all platforms, output formats, file operations, and logging scenarios.