Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gardening]: batch swiftlint calls for all modified files #261

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
git diff --diff-filter=d --staged --name-only | grep -e '\.swift$' | while read line; do
swift run swiftformat "${line}" --quiet;
git add "$line";
done

swift_files=$(git diff --diff-filter=d --staged --name-only -- '*.swift')

echo $swift_files | xargs swift run swiftformat --quiet

echo $swift_files | xargs git add
7 changes: 6 additions & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
--indent 4
# file config

--swiftversion 5.7
--exclude Pods,Tooling,**Dummy.swift

# format config

--indent 4

--wraparguments before-first
--importgrouping testable-bottom

Expand Down