Skip to content

Commit 0afaa26

Browse files
authored
improve swift-format checks -- same as mlx-swift (#399)
1 parent 1a16bc3 commit 0afaa26

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.circleci/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ jobs:
2929
command: |
3030
pip install pre-commit
3131
brew install swift-format
32-
pre-commit run --all
33-
if ! git diff --quiet; then echo 'Style checks failed, please install pre-commit and run pre-commit run --all and push the change'; exit 1; fi
32+
pre-commit run --all || (echo "Style checks failed, please install pre-commit and run pre-commit run --all and push the change"; echo ""; git --no-pager diff; exit 1)
3433
- run:
3534
name: Run Tests (Xcode, macOS)
3635
command: |

.pre-commit-config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
repos:
2+
23
- repo: local
34
hooks:
45
- id: swift-format
56
name: swift-format
67
language: system
7-
entry: swift-format --in-place
8-
files: '\.swift$'
8+
entry: swift-format format --in-place --configuration .swift-format --recursive .
9+
require_serial: true
10+
types: [swift]

0 commit comments

Comments
 (0)