Skip to content

Commit 385cfb2

Browse files
authored
Add script to run the correct invocations of swift format (#730)
1 parent 7692b62 commit 385cfb2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Scripts/format.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
##===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the Swift Argument Parser open source project
5+
##
6+
## Copyright (c) 2025 Apple Inc. and the Swift project authors
7+
## Licensed under Apache License v2.0 with Runtime Library Exception
8+
##
9+
## See https://swift.org/LICENSE.txt for license information
10+
##
11+
##===----------------------------------------------------------------------===##
12+
13+
# Move to the project root
14+
cd "$(dirname "$0")" || exit
15+
cd ..
16+
echo "Formatting Swift sources in $(pwd)"
17+
18+
# Run the format / lint commands
19+
git ls-files -z '*.swift' | xargs -0 swift format format --parallel --in-place
20+
git ls-files -z '*.swift' | xargs -0 swift format lint --strict --parallel

0 commit comments

Comments
 (0)