alan-turing-institute / python-project-template

15 stars 3 forks source link

Figure out how to update pre-commit config #18

Closed phinate closed 5 months ago

phinate commented 9 months ago

Would be nice to figure out how to automatically update the .pre-commit-config.yaml file.

This could be done with pre-commit.ci, which is set up on this repo, but can't find the file since it's not in the root of the directory! Haven't yet found a way to configure this.

Jacob-Stevens-Haas commented 9 months ago

Hey Nathan, how about making the template repository a git submodule hosted in a different repo? That way, pre-commit-config.yml would be at the top of the submodule's repo?

A potential, more "manual" version might be a cron-based github action to install from pre-commit-config.yml, run pre-commit autoupdate, and PR any differences.

jack89roberts commented 8 months ago

We have a cron job updating poetry + pre-commit dependency versions once a month in the ARC template. For the directory issue, is it not possible to cd into the sub-directory and then run the update from there?

phinate commented 6 months ago

This was added as part of #27, though I haven't seen the commit yet (possibly due to it only being monthly like yours @jack89roberts). Maybe I should merge it as a triggerable workflow first and make sure it runs?

jack89roberts commented 6 months ago

It should run on Friday the way it's configured now so not too long to wait otherwise 😄

Jacob-Stevens-Haas commented 6 months ago

Maybe I should merge it as a triggerable workflow first and make sure it runs?

I've gotten CI wrong more than right, so I did this when I PR'd a cron-based workflow. Once it worked, I set the cron job to run shortly after I expected to merge the change, in order to get feedback from any additional mistake.

phinate commented 5 months ago

This is fixed now by #45 and co!