Skip to content

Add a soundness --fix flag #22

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

Merged
merged 5 commits into from
Oct 25, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
PR feedback - use an array
  • Loading branch information
czechboy0 committed Oct 25, 2023
commit 217166659c723faa5f52961657439865fd15e38c
6 changes: 3 additions & 3 deletions scripts/run-swift-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ fatal() { error "$@"; exit 1; }
CURRENT_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REPO_ROOT="$(git -C "${CURRENT_SCRIPT_DIR}" rev-parse --show-toplevel)"

FORMAT_COMMAND="lint --strict"
FORMAT_COMMAND=(lint --strict)
for arg in "$@"; do
if [ "$arg" == "--fix" ]; then
FORMAT_COMMAND="format --in-place"
FORMAT_COMMAND=(format --in-place)
fi
done

SWIFTFORMAT_BIN=${SWIFTFORMAT_BIN:-$(command -v swift-format)} || fatal "❌ SWIFTFORMAT_BIN unset and no swift-format on PATH"

"${SWIFTFORMAT_BIN}" $FORMAT_COMMAND \
"${SWIFTFORMAT_BIN}" "$FORMAT_COMMAND" \
--parallel --recursive \
"${REPO_ROOT}/Sources" "${REPO_ROOT}/Tests" \
&& SWIFT_FORMAT_RC=$? || SWIFT_FORMAT_RC=$?
Expand Down