feat: standardize exit codes, fix tests, apply pre-commit - #26
Merged
Conversation
- Add email_processor.exit_codes.ExitCode enum (SUCCESS, PROCESSING_ERROR, VALIDATION_FAILED, FILE_NOT_FOUND, UNSUPPORTED_FORMAT, etc.) - CLI commands (config, imap, passwords, smtp, status) and __main__ return ExitCode values instead of raw ints - Fix test_full_cycle_send_folder: use isolated sent_files_dir to avoid shared state; assert SMTP connect on ExitCode.SUCCESS - Fix test_create_default_config_example_not_found_with_rich_console: expect ExitCode.FILE_NOT_FOUND (config returns it when example missing) - Pre-commit: normalize line endings (mixed-line-ending), ruff-format - Update tests and integration checks for new exit codes
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- email_processor_run.bat: run 'py -m email_processor run' explicitly - run_tests.bat: pytest tests/, add REM - test_email_processor.bat: send folder + recipient env, use run - install_context_menu: send file + to/config args, Optional Path - run_all_tests: cov-fail-under 95
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.
Description
Standardize CLI exit codes via a dedicated
ExitCodeenum, fix two failing tests, apply pre-commit fixes (line endings, ruff-format), and update documentation.Closes #25
Type of Change
Related Issue
Closes #25
Changes Made
email_processor.exit_codes.ExitCodeenum (SUCCESS,PROCESSING_ERROR,VALIDATION_FAILED,FILE_NOT_FOUND,UNSUPPORTED_FORMAT,WARNINGS_AS_ERRORS,CONFIG_ERROR). CLI commands (config, imap, passwords, smtp, status) and__main__returnExitCodevalues instead of raw ints.test_full_cycle_send_folder(use isolatedsent_files_dir, assert SMTP connect onExitCode.SUCCESS) andtest_create_default_config_example_not_found_with_rich_console(expectExitCode.FILE_NOT_FOUND).exit_codesmodule docstring "See also" → README § Exit Codes.install_context_menuargs,run_all_testscov 95.Testing
Checklist
pre-commit run --all-files)ruff format --check .)ruff check .)Additional Notes
create_default_configreturnsExitCode.FILE_NOT_FOUNDwhen the example config is missing;test_create_default_config_example_not_found_with_rich_consolewas updated accordingly.sent_files_dirso it doesn't share sent-file state with other tests (same mock PDF hash could otherwise be marked sent).