Set up git pre-commit hooks for a Swift project using SwiftFormat and SwiftLint on staged files, with an optional build or test gate. Use when the user wants pre-commit hooks, commit-time formatting, or lint enforcement in an iOS/macOS repo.