rtts / djhtml

Django/Jinja template indenter
GNU General Public License v3.0
582 stars 32 forks source link

Recommend using tags for pre-commit #44

Closed adamchainz closed 2 years ago

adamchainz commented 2 years ago

pre-commit heavily discourages using a branch name for rev as that prevents repeatable environments, and autoupdates don't work.

JaapJoris commented 2 years ago

I know, that's why the documentation continues with:

Finally, run the following command: $ pre-commit autoupdate

That command will replace main with the latest tag on GitHub. Together, these instructions have the same result as doing it manually, namely that .pre-commit-config.yaml contains an explicit tag name as recommended by pre-commit.

Or am I missing something?

adamchainz commented 2 years ago

I missed reading that. I guess I skimmed it and expected to see the same as all the pre-commit official repos e.g. https://github.com/pre-commit/mirrors-mypy#mypy-mirror

I also didn't know autoupdate would pull the latest tag - TIL.

Up to you if you adjust to the other format. Maybe a comment in the YAML like main # run autoupdate to pin to a version would do.

adamchainz commented 2 years ago

👍👍