Command-Line Interface¶
Defines the command-line interface for the code validator.
This module is responsible for parsing command-line arguments, setting up the application configuration, and orchestrating the main validation workflow. It acts as the primary entry point for user interaction when the tool is called from the terminal.
The main function, run_from_cli, handles the entire application lifecycle, including robust top-level error handling to ensure meaningful exit codes.
- code_validator.cli.run_from_cli() None¶
Runs the full application lifecycle from the command line.
This is the main entry point for the validate-code script. It performs the following steps: 1. Parses command-line arguments. 2. Initializes the logger, console, and configuration. 3. Instantiates and runs the StaticValidator. 4. Handles all top-level exceptions and exits with an appropriate status code.
- Raises:
SystemExit – This function will always terminate the process with an exit code defined in the ExitCode enum.
- code_validator.cli.setup_arg_parser() ArgumentParser¶
Creates and configures the argument parser for the CLI.
This function defines all positional and optional arguments that the validate-code command accepts, including their types, help messages, and default values.
- Returns:
- A fully configured parser instance ready to
process command-line arguments.
- Return type:
argparse.ArgumentParser