Extract Verbosity Filtering Logic
Issue: This issue
Parent Epic: #102 - User Output Architecture Improvements
Related: Refactoring Plan - Proposal #0
Overview
Extract verbosity checking logic from UserOutput into a dedicated VerbosityFilter struct. This eliminates code duplication across all output methods and makes verbosity rules testable independently.
See detailed specification: docs/issues/extract-verbosity-filtering-logic.md (will be renamed after issue creation)
Implementation Plan
Phase 1: Create VerbosityFilter (30 minutes)
Phase 2: Add Unit Tests (45 minutes)
Phase 3: Integrate with UserOutput (1 hour)
Phase 4: Verify & Clean Up (30 minutes)
Acceptance Criteria
Quality Checks:
Task-Specific Criteria:
Estimated Time
Total: ~3 hours (conservative estimate with testing and verification)
Extract Verbosity Filtering Logic
Issue: This issue
Parent Epic: #102 - User Output Architecture Improvements
Related: Refactoring Plan - Proposal #0
Overview
Extract verbosity checking logic from
UserOutputinto a dedicatedVerbosityFilterstruct. This eliminates code duplication across all output methods and makes verbosity rules testable independently.See detailed specification: docs/issues/extract-verbosity-filtering-logic.md (will be renamed after issue creation)
Implementation Plan
Phase 1: Create VerbosityFilter (30 minutes)
VerbosityFilterstruct withlevelfieldnew()constructorshould_show()base methodshould_show_progress(),should_show_errors(), etc.Phase 2: Add Unit Tests (45 minutes)
should_show_progress()at different verbosity levelsshould_show_errors()always returns trueshould_show()methodPhase 3: Integrate with UserOutput (1 hour)
verbosity: VerbosityLevelfield withverbosity_filter: VerbosityFilterUserOutput::new()constructorUserOutput::with_writers()constructorverbosity_filter.should_show_X()Phase 4: Verify & Clean Up (30 minutes)
cargo run --bin linter allAcceptance Criteria
Quality Checks:
./scripts/pre-commit.shTask-Specific Criteria:
VerbosityFilterstruct created with all required methodsVerbosityFilterbehaviorUserOutputAPIEstimated Time
Total: ~3 hours (conservative estimate with testing and verification)