feat: add Swift language-specific rules

Add 5 rule files for Swift following the established pattern used by
TypeScript, Python, and Go rule sets. Covers Swift 6 strict concurrency,
Swift Testing framework, protocol-oriented patterns, Keychain-based
secret management, and SwiftFormat/SwiftLint hooks.
This commit is contained in:
Maksim Dimitrov
2026-02-17 15:43:14 +02:00
parent 0b11849f1e
commit 6792e91735
6 changed files with 215 additions and 1 deletions

20
rules/swift/hooks.md Normal file
View File

@@ -0,0 +1,20 @@
---
paths:
- "**/*.swift"
- "**/Package.swift"
---
# Swift Hooks
> This file extends [common/hooks.md](../common/hooks.md) with Swift specific content.
## PostToolUse Hooks
Configure in `~/.claude/settings.json`:
- **SwiftFormat**: Auto-format `.swift` files after edit
- **SwiftLint**: Run lint checks after editing `.swift` files
- **swift build**: Type-check modified packages after edit
## Warning
Flag `print()` statements — use `os.Logger` or structured logging instead for production code.