File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,32 @@ jobs:
132132 - name : Check for API breaking changes
133133 run : swift package diagnose-api-breaking-changes origin/main
134134
135+ format-check :
136+ name : swift-format Check
137+ # Only on pull requests
138+ if : github.event_name == 'pull_request'
139+ runs-on : ubuntu-latest
140+ container :
141+ # Use use the latest Swift release and that's the version of swift-format
142+ # people should use.
143+ image : swift:latest
144+ steps :
145+ - name : Checkout
146+ uses : actions/checkout@v4
147+ - name : Mark the workspace as safe
148+ # https://github.com/actions/checkout/issues/766
149+ run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
150+ - name : Run format check
151+ run : |
152+ set -eu
153+ git ls-files -z '*.swift' | xargs -0 swift format format --parallel --in-place
154+ GIT_PAGER='' git diff --exit-code '*.swift'
155+ # Disabled as it produces multiple warnings at the moment.
156+ # - name: Run format lint check
157+ # run: |
158+ # set -eu
159+ # git ls-files -z '*.swift' | xargs -0 swift format lint --strict --parallel
160+
135161 sanitizer_testing :
136162 runs-on : ubuntu-latest
137163 strategy :
You can’t perform that action at this time.
0 commit comments