sunpy / package-template

A cookiecutter template for packages that want to have a similar setup to sunpy
2 stars 4 forks source link

Automate updating the templates pre-commit config file so we keep it up to date. #33

Closed Cadair closed 2 months ago

Cadair commented 4 months ago

Describe the feature

As mentioned by @nabobalis here we should disable pre-commit auto-updates on all templated repos and then have the template auto-update and roll out the update to all the repos as part of the regular template auto-updates.

The pre-commit.ci bot which autoupdates all the repos at the moment wont work (it will update the pre-commit config in the root of the repo) so we will have to figure out some other way to do the updates.

Proposed solution

It looks like the pre-commit CLI allows you to specify which pre-commit file you update, so we can add a GH actions workflow which runs this:

$ pre-commit autoupdate -c '{{ cookiecutter.package_name }}/.pre-commit-config.yml'
[https://github.com/astral-sh/ruff-pre-commit] already up to date!
[https://github.com/pre-commit/pre-commit-hooks] already up to date!