Only run swiftformat in the LoopFollow folder [skip ci] by bjorkert · Pull Request #444 · loopandlearn/LoopFollow
Problem
The swiftformat script was running on LoopFollow_second, LoopFollow_third, replacing original author headers. This caused incorrect attribution since git sees the person who copied the files as the "author" in these repos.
Solution
Modified the swiftformat build script to only run on the main LoopFollow repository by checking that the folder name is exactly "LoopFollow".
Changes
- Added folder name validation before running swiftformat
- Script exits gracefully (exit 0) when run in non-LoopFollow directories
- Shows informative skip message for clarity
Impact
- Original author headers preserved in derivative repos
- No change to main LoopFollow repo behavior
- Build processes remain unaffected
Testing
- Verified script runs normally in
LoopFollowdirectory - Confirmed script skips execution in
LoopFollow_seconddirectory - Builds complete successfully in both scenarios