From 2e5c782de79166fabaac59d691e2a3b624b5c6c4 Mon Sep 17 00:00:00 2001 From: Nikhil Kalra Date: Mon, 10 Feb 2025 19:52:18 -0800 Subject: [PATCH 1/3] Add pre-commit hook for linting - `swift-lint` for invoking `swift-format lint` with the default options - `swift-lint-strict` for invoking `swift-format lint --strict` --- .pre-commit-hooks.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index f7fd11fa5..1b5c8bd52 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -4,3 +4,15 @@ language: swift types: [swift] require_serial: true +- id: swift-lint + name: swift-lint + entry: swift-format lint + language: swift + types: [swift] + require_serial: true +- id: swift-lint-strict + name: swift-lint-strict + entry: swift-format lint --strict + language: swift + types: [swift] + require_serial: true From 35e010c28e60ce5f5bf567fd2aa5dfd4f23acce3 Mon Sep 17 00:00:00 2001 From: Nikhil Kalra Date: Tue, 11 Feb 2025 10:09:11 -0800 Subject: [PATCH 2/3] Rename to `swift-format-lint` --- .pre-commit-hooks.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 1b5c8bd52..a389becf6 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -4,14 +4,14 @@ language: swift types: [swift] require_serial: true -- id: swift-lint - name: swift-lint +- id: swift-format-lint + name: swift-format-lint entry: swift-format lint language: swift types: [swift] require_serial: true -- id: swift-lint-strict - name: swift-lint-strict +- id: swift-format-lint-strict + name: swift-format-lint-strict entry: swift-format lint --strict language: swift types: [swift] From e27e49c64ca1e612e1138188fb5d78d180bb24b9 Mon Sep 17 00:00:00 2001 From: Nikhil Kalra Date: Wed, 12 Feb 2025 12:40:18 -0800 Subject: [PATCH 3/3] Do strict/recursive/parallel --- .pre-commit-hooks.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index a389becf6..f102f6552 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -6,13 +6,7 @@ require_serial: true - id: swift-format-lint name: swift-format-lint - entry: swift-format lint - language: swift - types: [swift] - require_serial: true -- id: swift-format-lint-strict - name: swift-format-lint-strict - entry: swift-format lint --strict + entry: swift-format lint --strict --recursive --parallel language: swift types: [swift] require_serial: true