cookiecutter-hypermodern-python icon indicating copy to clipboard operation
cookiecutter-hypermodern-python copied to clipboard

Add GA action to update pre-commit configuration

Open cjolowicz opened this issue 5 years ago • 4 comments

Here is an example using a cron-style approach from cookiecutter-django:

https://github.com/pydanny/cookiecutter-django/blob/master/.github/workflows/pre-commit-autoupdate.yml

This is useful both for generated projects and for the Cookiecutter itself, as both use the Prettier, a non-Python hook which is not updated by Dependabot.

cjolowicz avatar Oct 10 '20 20:10 cjolowicz

See also https://browniebroke.com/blog/gh-action-pre-commit-autoupdate/

cjolowicz avatar Nov 19 '21 16:11 cjolowicz

maybe https://pre-commit.ci/

eyllanesc avatar Feb 11 '22 15:02 eyllanesc

@eyllanesc I'm wondering if it's possible to use pre-commit.ci for updates only, without actually running hooks. Most of our hooks are system hooks, so pre-commit.ci can't run them. In fact, would it even accept a pre-commit config containing a system hook?

cjolowicz avatar Feb 11 '22 17:02 cjolowicz

@cjolowicz One workaround is to use skip option so that it doesn't execute local hooks.

ci:
  skip:
    - black
    - check-added-large-files
    - check-toml
    - check-yaml
    - end-of-file-fixer
    - flake8
    - isort
    - pyupgrade
    - trailing-whitespace
repos:
  - repo: local
    hooks:
      - id: black
        # ...

eyllanesc avatar Feb 11 '22 17:02 eyllanesc