From 4d5721cc51d2ca49f800d904108adfd267d52fb6 Mon Sep 17 00:00:00 2001 From: Yunosuke Sakai Date: Mon, 21 Oct 2024 21:41:27 +0900 Subject: [PATCH] setup swift-format --- .github/workflows/format.yml | 16 ++++++++-------- .swift-format | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 .swift-format diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 9d0035b..3a634ae 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,4 +1,4 @@ -name: SwiftFormat +name: swift-format on: push: @@ -11,14 +11,14 @@ jobs: runs-on: macos-15 steps: - uses: actions/checkout@v2 - - name: Install SwiftFormat - run: brew install swiftformat - - name: Run SwiftFormat - run: swiftformat --verbose . + - name: Install swift-format + run: brew install swift-format + - name: Run swift-format + run: swift-format . --in-place --recursive --configuration .swift-format - uses: peter-evans/create-pull-request@v6 with: - commit-message: run SwiftFormat + commit-message: run swift-format delete-branch: true - title: Run SwiftFormat + title: Run swift-format reviewers: ski-u - branch: run-swiftformat + branch: run-swift-format diff --git a/.swift-format b/.swift-format new file mode 100644 index 0000000..fb32b0c --- /dev/null +++ b/.swift-format @@ -0,0 +1,18 @@ +{ + "version": 1, + "lineLength": 120, + "indentation": { + "spaces": 4 + }, + "lineBreakBeforeEachArgument": true, + "indentConditionalCompilationBlocks": false, + "prioritizeKeepingFunctionOutputTogether": true, + "rules": { + "AlwaysUseLowerCamelCase": false, + "AmbiguousTrailingClosureOverload": false, + "NoBlockComments": false, + "OrderedImports": true, + "UseLetInEveryBoundCaseVariable": false, + "UseSynthesizedInitializer": false + } +}