Skip to content

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

@theNded

Description

@theNded

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions