Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for official .pre-commit-hooks.yaml #676

Open
theNded opened this issue Jan 8, 2024 · 1 comment · May be fixed by #712
Open

Request for official .pre-commit-hooks.yaml #676

theNded opened this issue Jan 8, 2024 · 1 comment · May be fixed by #712

Comments

@theNded
Copy link

theNded commented Jan 8, 2024

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:

- 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.

@ahoppen
Copy link
Member

ahoppen commented Apr 23, 2024

Tracked in Apple’s issue tracker as rdar://126948337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants