I'm wondering if the dev team has a plan of supporting pre-commit. It would be super helpful to have the pre-commit hook config in the official repo.
Right now we cannot use the remote repo approach in configuring swift-format as a hook; we have to either fork the repo or use the local repo approach. For reference, this is my configuration:
- repo: local
hooks:
- id: swift-format
name: swift-format
entry: swift-format format -i --configuration .swift-format
language: system
types: [swift]
- id: swift-lint
name: swift-lint
entry: swift-format lint --configuration .swift-format --strict
language: system
types: [swift]
Background: I've been using SwiftLint as the linter. It does provide a pre-commit hook, but it is less satisfactory for the formatting task.
Thanks for the great work!
I'm wondering if the dev team has a plan of supporting pre-commit. It would be super helpful to have the pre-commit hook config in the official repo.
Right now we cannot use the remote repo approach in configuring
swift-format
as a hook; we have to either fork the repo or use the local repo approach. For reference, this is my configuration:Background: I've been using SwiftLint as the linter. It does provide a pre-commit hook, but it is less satisfactory for the formatting task.