ProjectPythia / cookbook-template

Project Pythia Cookbook template
https://projectpythia.org/cookbook-template/
Apache License 2.0
21 stars 16 forks source link

Remove prettier from pre-commit #174

Open brian-rose opened 1 month ago

brian-rose commented 1 month ago

As suggested by @dopplershift, due to the continued aggravation of pre-commit opening PRs that include pre-release alpha versions of prettier, this PR just removes prettier entirely from our pre-commit config.

github-actions[bot] commented 1 month ago

👋 Thanks for opening this PR! The Cookbook will be automatically built with GitHub Actions. To see the status of your deployment, click below. 🔍 Git commit SHA: c43c836278cc13b291c7c54dae5020a4a63d583e ✅ Deployment Preview URL: https://ProjectPythia.github.io/cookbook-template/_preview/174

brian-rose commented 1 month ago

Other repos that suffer from the same issue include

brian-rose commented 1 month ago

@dopplershift are you aware of any issue tracking the problem with pre-commit and prettier releases that we can link here?

It would be great to get the functionality of prettier back once the headaches are resolved.

dopplershift commented 1 month ago

Let's just say upstream is less than interested about doing anything about this. "Working as intended" was one phrase I saw. 🙄

dopplershift commented 1 month ago

For the record, an attitude like that from upstream (not the first time I've seen it) has me reconsidering future use of pre-commit in my projects.

brian-rose commented 1 month ago

Good to know that there's essentially zero chance of an upcoming change in how pre-commit handles these cases.

Are we happy with the compromise of just removing prettier from the pre-commit list, and thus losing its functionality? Here and in several other of our repos?

brian-rose commented 1 month ago

There might be a viable alternative: keep using prettier, but exclude it from auto-updates (and thus need to manually update its version in .pre-commit-config.yaml when we are ready to upgrade.

If I'm interpreting these docs correctly, we should be able to do this just by adding this block to .pre-commit-config.yaml:

ci:
    skip: [prettier]

@dopplershift does that sound correct?

dopplershift commented 1 month ago

@brian-rose My read of those docs implies that this will only skip running prettier on the pre-commit CI service, not disable updating the version. I can find no way to dial back updates, only ways to store hashes for versions or use "bleeding edge": https://pre-commit.com/#pre-commit-autoupdate

dopplershift commented 1 month ago

@dcamron and I have also found that currently precommit-ci is only set to run on 7 of our own repositories, not any of the cookbook repos (and currently that list would have to be added to manually rather than having "all repositories" set). I think we need to think a little more about what we want the user experience to be, both locally and on GitHub.

dcamron commented 1 week ago

Closes #186