Skip to content

Commit bd7db9e

Browse files
committed
Merge branch 'feature/strikethrough-tests'
2 parents d9bb731 + 98de937 commit bd7db9e

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

IMPROVEMENT_ROADMAP.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,20 @@ It's better to keep the readable, maintainable version rather than introduce unn
127127
**Missing Test Scenarios**:
128128
- Windows platform-specific tests
129129
- Thread safety tests
130-
- `strikethrough` style tests (implemented but not tested)
130+
- ~~`strikethrough` style tests (implemented but not tested)~~**COMPLETED**
131131

132132
**Action Items**:
133133
1. Add Windows-specific test suite
134134
2. Add stress tests for concurrent access
135-
3. Add tests for `strikethrough` style
135+
3. ~~Add tests for `strikethrough` style~~**COMPLETED**
136136

137137
### 2.2 Feature Enhancements
138138

139139
#### 2.2.1 Style Presets
140+
141+
**Status**: ❌ **REJECTED** - After careful consideration, determined not to implement
142+
143+
**Original Proposal**:
140144
```swift
141145
extension String {
142146
static let errorStyle = { $0.red.bold }
@@ -149,6 +153,22 @@ extension String {
149153
print("Error: File not found".errorStyle())
150154
```
151155

156+
**Why This Was Rejected**:
157+
1. **API Inconsistency**: The closure syntax `errorStyle()` doesn't match Rainbow's property-based API (`.red`, `.bold`)
158+
2. **User Flexibility**: Style preferences vary greatly between projects and teams
159+
3. **Easy to Implement**: Users can trivially create their own presets:
160+
```swift
161+
// User-defined extension
162+
extension String {
163+
var error: String { self.red.bold }
164+
var success: String { self.green }
165+
}
166+
```
167+
4. **Maintain Simplicity**: Rainbow should provide core functionality, not opinionated defaults
168+
5. **No Universal Standards**: What constitutes "error" or "success" colors varies by terminal theme and user preference
169+
170+
**Recommendation**: Document best practices and examples in README for users to create their own style presets.
171+
152172
#### 2.2.2 HSL Color Support
153173

154174
**Status**: ✅ **COMPLETED**
@@ -326,11 +346,11 @@ Sources/Rainbow/
326346
4. ~~Fix code duplication issues~~**REJECTED - Acceptable duplication, keep current implementation**
327347

328348
### Phase 2: Feature Enhancement (2-3 weeks)
329-
1. Implement style presets
349+
1. ~~Implement style presets~~**REJECTED - See section 2.2.1**
330350
2.**COMPLETED** - Add HSL color support
331351
3. Improve API naming (maintain backward compatibility)
332352
4.**COMPLETED** - Add conditional styling
333-
5. Implement missing styles (strikethrough in extensions)
353+
5. ~~Implement missing styles (strikethrough in extensions)~~**COMPLETED**
334354

335355
### Phase 3: Long-term Improvements (1 month)
336356
1. Restructure code organization
@@ -397,11 +417,11 @@ When implementing these improvements:
397417

398418
- **Week 1-2**: ✅ **COMPLETED** - High priority fixes (performance optimization, stability analysis)
399419
- **Week 3-5**: ✅ **COMPLETED** - Medium priority features (HSL color support, conditional styling, enhanced testing)
400-
- **Week 6-8**: 🟡 **IN PROGRESS** - Additional features (style presets, strikethrough tests, Windows tests)
420+
- **Week 6-8**: 🟡 **IN PROGRESS** - Additional features (~~style presets~~, ~~strikethrough tests~~, Windows tests)
401421
- **Week 9-10**: Testing, benchmarking, and release preparation
402422

403423
## Notes
404424

405425
This roadmap is a living document and should be updated as work progresses. Priority levels may be adjusted based on user feedback and real-world usage patterns.
406426

407-
Last updated: July 2025 - Updated with conditional styling completion and comprehensive test coverage improvements
427+
Last updated: July 2025 - Updated with strikethrough implementation, style presets rejection decision, and comprehensive test coverage improvements

Sources/String+Rainbow.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ extension String {
394394
public var blink: String { return applyingStyle(.blink) }
395395
/// String with text color and background color swapped.
396396
public var swap: String { return applyingStyle(.swap) }
397-
/// String with strikethrough style.
397+
/// String with strikethrough style. This may not be supported in all terminals, particularly macOS Terminal.app.
398398
public var strikethrough: String { return applyingStyle(.strikethrough) }
399399
}
400400

0 commit comments

Comments
 (0)