This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Build the package
swift build
# Run tests
swift test
# Run specific test
swift test --filter TestName# Format code
swiftformat . --config shared-swiftformat.yml
# Lint code
swiftlint lint --config shared-swiftlint.yml
# Test custom SwiftLint rules (regex-based)
cd swiftlint-tests && ./test-swiftlint-rules.sh
# Test SwiftSyntax-based rules (more accurate, better performance)
cd swiftlint-swiftsyntax-integration && ./scripts/check-file.sh path/to/file.swift
cd swiftlint-swiftsyntax-integration && ./scripts/check-project.sh path/to/projectSynodicTools is a zero-dependency Swift utility library providing extensions and data structures for iOS 15+ and macOS 12+ development. The architecture is extension-based with strong emphasis on code quality through comprehensive tooling.
Mathematical Utilities:
Fraction.swift: Complete fraction implementation with mixed number supportBinaryFloatingPoint+Extensions.swift: Inverse linear interpolation functionalityPercent.swift: Property wrapper for percentage handling with type conversions
Collection Extensions:
Array+Extensions.swift: Statistical functions and interspacing utilitiesCollection+Extensions.swift: Safe indexing withsubscript(safeIndex:)RangeReplaceableCollection+Extensions.swift: Safe appending to optional collections
Foundation & SwiftUI Extensions:
Calendar+Extensions.swift: Date utilities (start of week/month/year)View+ModifierGroup.swift: View modifier grouping functionality
The codebase uses an extensive quality assurance system:
-
SwiftFormat Configuration (
shared-swiftformat.yml): 100+ formatting rules targeting Swift 6.0 -
SwiftLint Configuration (
shared-swiftlint.yml): Custom rules including:- Skimmable SwiftUI body (10 lines max)
- SwiftUI View structure enforcement (property ordering)
- Spacer vs. frame alignment patterns
- Performance optimizations
-
Custom Rule Testing (
swiftlint-tests/): Comprehensive test suite validating all custom SwiftLint rules -
SwiftSyntax Integration (
swiftlint-swiftsyntax-integration/): Advanced SwiftSyntax-based rules for accurate AST analysis
- Extension-Based Design: All functionality provided through Swift extensions
- Protocol-Oriented Programming: Generic implementations using Swift protocols
- Type Safety: Strong typing with property wrappers and custom types
- Public API Design: Clear naming conventions and inline documentation
Focus testing on complex functionality and edge cases. The swiftlint-tests/ directory contains validation tests for all custom linting rules.
- Zero Dependencies: Keep the package self-contained
- Platform Support: iOS 15+ and macOS 12+ minimum
- Swift Version: Targeting Swift 6.0 for future-proofing
- Code Quality: All changes must pass both SwiftFormat and SwiftLint validation
- Testing: Use Swift Testing framework for new tests, migrate existing XCTest code when possible