Skip to content

Piloting pre-commit.ci - a service for use with repo's with a .pre-commit-config.yaml #222

@consideRatio

Description

@consideRatio

In dask/dask-gateway#476, we have now started piloting the use of https://pre-commit.ci - a service that helps open source projects having a .pre-commit-config.yaml file.

Why pilot pre-commit.ci?

I wanted to champion it because I wanted the quality of life improvements it gives me as a maintainer. I've grown very fond of them by using the service in various JupyterHub projects. While I initially felt uneasy about relying on another service, it has been great:

  • getting automated updates to the .pre-commit-config.yaml file with new versions
  • and getting automated commits pushed to contributors PRs without needing to ask them to learn about pre-commit

What pre-commit.ci does

  1. Verifies pre-commit is happy based on the config - a test
  2. Regularly updates the .pre-commit-config.yaml configured hooks with more modern versions, once a week.
  3. Automatically pushes a commit to PRs that have a failing pre-commit check with autoformatting changes made by pre-commit.

To pilot pre-commit.ci use in another project

To pilot the use in another project as well, what you should do is to enable the pre-commit.ci service for that repo via https://github.com/organizations/dask/settings/installations and optionally remove previous configuration to run pre-commit in GitHub workflows etc that will no longer be needed.

I could recommend documenting the .pre-commit-config.yaml file quite well, helping anyone trying to understand what that is about by inline comments. For that you could also look to https://github.com/dask/dask-gateway/blob/main/.pre-commit-config.yaml for inspiration. PS: I really appreciate having inline comments on top of misc files in repos to help maintainers understand what they are about etc, this is an example of that practice.

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