Implement the CLI entry point for pronote-sync: cli/main.py: - main() entry point with --dry-run (tri-state: None defers to settings, True overrides) and --log-level (choices: DEBUG/INFO/WARNING/ERROR/CRITICAL) - setup_logging called before settings load (to capture config errors), then reconfigured with settings.app.log_level - PipelineRunner.from_settings() as composition root, runner.run() - Return codes: 0 success, 1 failure, 2 argparse rejection - _safe_traceback: strips exception messages, replaces with "erreur expurgée", walks __cause__/__context__ with cycle protection - _settings_secrets: collects redaction_secrets() + usernames + JID/recipient - All error messages redacted via redact_secrets() with configured secrets - DEBUG-level traceback only shown when DEBUG is enabled cli/__init__.py: - Module docstring added (French, Sphinx/reST) tests/e2e/test_cli.py (8 tests): - Dry-run and log-level propagation to composition root - Configured dry-run preserved (tri-state None) - Success with warnings returns 0 - Pipeline error redaction at DEBUG (sentinel secret) - Configuration failure redacted traceback at DEBUG - Pronote username non-disclosure - Unexpected pipeline exception: redacted traceback at DEBUG, no traceback at INFO - Argparse rejection of unknown log level (exit code 2) Coverage: cli/ 94.74%, 627 total tests pass. Co-authored-by: opencode/coder <coder@agents.invalid> Co-authored-by: opencode/test-engineer <test-engineer@agents.invalid>
6.6 KiB
6.6 KiB