Edinho
98d73611ad
feat: Add comprehensive Swift language detection support (#223)
* feat: Add comprehensive Swift language detection support
Add Swift language detection with 40+ patterns covering syntax, stdlib, frameworks, and idioms. Implement fork-friendly architecture with separate swift_patterns.py module and graceful import fallback.
Key changes:
- New swift_patterns.py: 40+ Swift detection patterns (SwiftUI, Combine, async/await, property wrappers, etc.)
- Enhanced language_detector.py: Graceful import handling, robust pattern compilation with error recovery
- Comprehensive test suite: 19 tests covering syntax, frameworks, edge cases, and error handling
- Updated .gitignore: Exclude Claude-specific config files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix: Fix Swift pattern false positives and add comprehensive error handling
Critical Fixes (Priority 0):
- Fix 'some' and 'any' keyword false positives by requiring capitalized type names
- Use (?-i:[A-Z]) to enforce case-sensitivity despite global IGNORECASE flag
- Prevents "some random" from being detected as Swift code
Error Handling (Priority 1):
- Wrap pattern validation in try/except to prevent module import crashes
- Add SWIFT_PATTERNS verification with logging after import
- Gracefully degrade to empty dict on validation errors
- Add 7 comprehensive error handling tests
Improvements (Priority 2):
- Remove fragile line number references in comments
- Add 5 new tests for previously untested patterns:
* Property observers (willSet/didSet)
* Memory management (weak var, unowned, [weak self])
* String interpolation
Test Results:
- All 92 tests passing (72 Swift + 20 language detection)
- Fixed regression: test_detect_unknown now passes
- 12 new tests added (7 error handling + 5 feature coverage)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-01 19:25:53 +03:00
..
2025-10-29 23:19:32 +03:00
2025-12-28 22:29:44 +03:00
2025-10-19 02:08:58 +03:00
2025-11-29 22:13:13 +03:00
2025-10-19 17:01:37 +03:00
2025-11-07 01:21:29 +03:00
2025-12-30 23:27:18 +03:00
2025-11-20 13:55:46 -08:00
2025-11-29 22:13:13 +03:00
2025-11-10 21:35:44 +03:00
2025-11-30 00:13:49 +03:00
2025-12-21 19:28:22 +03:00
2025-12-21 19:45:06 +03:00
2025-11-29 21:55:46 +03:00
2025-12-22 02:04:32 +03:00
2025-12-28 21:35:21 +03:00
2025-12-26 00:45:48 +03:00
2025-12-26 00:45:48 +03:00
2025-11-07 01:14:24 +03:00
2025-12-21 22:53:05 +03:00
2025-11-29 22:13:13 +03:00
2025-11-07 01:14:24 +03:00
2025-11-07 01:14:24 +03:00
2025-12-26 00:45:48 +03:00
2025-12-21 19:45:06 +03:00
2025-12-26 00:45:48 +03:00
2025-11-29 21:34:51 +03:00
2026-01-01 18:57:21 +03:00
2025-11-07 01:21:29 +03:00
2025-10-23 21:43:05 +03:00
2025-12-21 22:53:05 +03:00
2025-11-29 21:55:46 +03:00
2025-10-26 13:05:39 +03:00
2025-11-29 21:34:51 +03:00
2025-11-07 01:14:24 +03:00
2025-12-26 00:45:48 +03:00
2025-12-26 00:45:48 +03:00
2025-11-29 22:56:37 +03:00
2025-12-28 18:06:50 +03:00
2025-12-21 19:28:22 +03:00
2026-01-01 19:25:53 +03:00
2025-11-29 21:34:51 +03:00
2025-11-11 22:26:52 +03:00
2025-11-07 01:21:29 +03:00
2025-11-10 21:35:44 +03:00
2025-12-21 22:57:27 +03:00