Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 177ed2a

Browse files
authoredMar 23, 2025··
Merge pull request #308 from swiftwasm/katei/format-code
Add .swift-format configuration and add a script to format
2 parents 6406ec2 + c5c9ff9 commit 177ed2a

File tree

66 files changed

+1477
-903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1477
-903
lines changed
 

‎.github/workflows/test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,18 @@ jobs:
6767
- run: swift build
6868
env:
6969
DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer/
70+
71+
format:
72+
runs-on: ubuntu-latest
73+
container:
74+
image: swift:6.0.3
75+
steps:
76+
- uses: actions/checkout@v4
77+
- run: ./Utilities/format.swift
78+
- name: Check for formatting changes
79+
run: |
80+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
81+
git diff --exit-code || {
82+
echo "::error::The formatting changed some files. Please run \`./Utilities/format.swift\` and commit the changes."
83+
exit 1
84+
}

‎.swift-format

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"lineLength": 120,
4+
"indentation": {
5+
"spaces": 4
6+
},
7+
"lineBreakBeforeEachArgument": true,
8+
"indentConditionalCompilationBlocks": false,
9+
"prioritizeKeepingFunctionOutputTogether": true,
10+
"rules": {
11+
"AlwaysUseLowerCamelCase": false
12+
}
13+
}

0 commit comments

Comments
 (0)
Please sign in to comment.