- add initialise_message_list fn to RuleProcessor trait and impl
- ensure rule is only processed on in-scope messages
- call initialise_message_list before processing any labels
- allow `log_messages` to take `pre` and `post` parameters
- this will allow calling functions to format the log output
- add documentation for parameters
Extract repeated test command setup into helper functions:
- run_init_with_dirs() for tests with separate config/rules directories
- run_init_with_credential() for tests with credential files
This eliminates code duplication and makes tests more maintainable.
Also fixed duplicate #[test] attribute warning.
Extract repeated InitCli instance creation into helper functions:
- create_test_init_cli() for default test instances
- create_test_init_cli_with_force() for force-enabled instances
This reduces code duplication and makes test setup more maintainable.
Prevent duplicate CreateDir operations when rules directory
is the same as config directory by checking if the directory
creation has already been planned before adding another one.
- Add test_init_with_separate_rules_directory to verify rules created in custom location
- Add test_init_rules_dir_dry_run to verify dry-run behavior with --rules-dir
- Verify config file contains correct rules path when using separate directory
- All 12 init integration tests passing (11 run, 1 ignored)
- Make parse_config_root() public for reuse in main.rs
- Add get_rules_path() helper to extract and resolve rules path from config
- Update main CLI to use configured rules path for default rule execution
- Add run_with_rules_path() method to RulesCli for custom path support
- Update all unit tests to include rules_dir field
- Rules path now supports h:, c:, r: prefixes throughout the application
- Add get_rules_from(path) function that accepts optional custom path
- Keep get_rules() as backward-compatible wrapper
- Automatically create and save default rules to custom path if not found
- Add Rules::load_from() and Rules::save_to() methods for custom paths
- Add --rules-dir option to init command
- Support h:, c:, r: path prefixes for rules directory
- Generate config file with correct rules path when using separate directory
- Create rules directory automatically if it doesn't exist
- Maintain backward compatibility with default ~/.cull-gmail/rules.toml
- Change &PathBuf to &Path parameter in plan_credential_file_operation
- Use inline format string in log message
- Both formatting and linting now clean