ソースを参照

Update formatting script (#1845)

Motivation:

The formatting script only checkes Sources and Tests. The Plugins and
Performance directory are currently not checked. Moreover the formatter
is using the 5.9 version.

Modifications:

- Update the formatter to use 5.10
- Upadte the formatting script to check Plugins and Performance

Result:

Formatting checks more places
George Barnett 1 年間 前
コミット
69821535fc
1 ファイル変更7 行追加3 行削除
  1. 7 3
      scripts/format.sh

+ 7 - 3
scripts/format.sh

@@ -56,7 +56,7 @@ THIS_SCRIPT=$0
 HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 REPO="$HERE/.."
 SWIFTFORMAT_DIR="$HERE/.swift-format-source"
-SWIFTFORMAT_VERSION=509.0.0
+SWIFTFORMAT_VERSION=510.0.0
 
 # Clone SwiftFormat if we don't already have it.
 if [ ! -d "$SWIFTFORMAT_DIR" ]; then
@@ -91,7 +91,9 @@ fi
 if "$lint"; then
   "${SWIFTFORMAT_BIN}" lint \
     --parallel --recursive --strict \
-    "${REPO}/Sources" "${REPO}/Tests" \
+    "${REPO}/Sources" \
+    "${REPO}/Tests" \
+    "${REPO}/Plugins" \
     && SWIFT_FORMAT_RC=$? || SWIFT_FORMAT_RC=$?
 
   if [[ "${SWIFT_FORMAT_RC}" -ne 0 ]]; then
@@ -108,7 +110,9 @@ if "$lint"; then
 elif "$format"; then
   "${SWIFTFORMAT_BIN}" format \
     --parallel --recursive --in-place \
-    "${REPO}/Sources" "${REPO}/Tests" \
+    "${REPO}/Sources" \
+    "${REPO}/Tests" \
+    "${REPO}/Plugins" \
     && SWIFT_FORMAT_RC=$? || SWIFT_FORMAT_RC=$?
 
   if [[ "${SWIFT_FORMAT_RC}" -ne 0 ]]; then