vibetunnel/scripts/lint.sh
Peter Steinberger b80c710c08 Add SwiftLint and SwiftFormat configuration for Swift 6
- Configure SwiftLint with Swift 6 compatible rules
- Disable conflicting self-related rules (implicit_self, redundant_self)
- Set up SwiftFormat to avoid self-rewrite conflicts
- Add custom rules for print statements and async/await patterns
- Create lint script and GitHub Actions workflow
- Add Package.swift for SPM dependencies
- Ensure proper exclusions for build directories and tests
2025-06-15 23:48:30 +02:00

28 lines
No EOL
627 B
Bash
Executable file

#!/bin/bash
# Swift linting and formatting script
set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
cd "$PROJECT_ROOT"
echo "Running SwiftFormat..."
if command -v swiftformat &> /dev/null; then
swiftformat . --verbose
else
echo "SwiftFormat not installed. Install with: brew install swiftformat"
exit 1
fi
echo "Running SwiftLint..."
if command -v swiftlint &> /dev/null; then
swiftlint --fix
swiftlint
else
echo "SwiftLint not installed. Install with: brew install swiftlint"
exit 1
fi
echo "✅ Linting complete!"