-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using chartpress with pre-commit #38
Comments
chartpress is often pretty expensive to run, which can be quite frustrating for pre-commit hooks, which need to be very quick to avoid causing friction. But it would at least be interesting to see an example |
Sure, my suggestion here is to only run it with the |
@minrk here's a full example of my
The result is something like this:
|
@rokroskar perhaps we could have this local hook example documented in the readme? What do you think? repos:
- repo: local
hooks:
- id: chartpress
name: chartpress reset
files: helm-chart/*
description: Run `chartpress --reset` to clean up helm charts before committing.
entry: pipenv run chartpress --reset
language: system
pass_filenames: false |
@consideRatio yes I think it could be useful for some - has definitely saved me from having to rebase/force-push my commits all the time :) But you might want to omit the |
I explored pre-commit a bit further and were happy to learn it really isn't disruptive at all, it works on a lines of code level and will not modify anything except whats conflicting etc. I added the following .pre-commit-config.yaml entry to the jupyterhub/zero-to-jupyterhub-k8s helm chart in jupyterhub/zero-to-jupyterhub-k8s#1970 A problem for people may be that I've no experience with chartpress hooks definitions etc, but if we can do something like...
Then I'd be up for defining a .pre-commit-hook.yaml as part of this repo and not only provide an example. But, in the linked PR, it wouldn't just work for the jupyterhub/binderhub repo I think for example, because of the difference of having chartpress.yaml defined in non-root folder |
Thanks for following up on this @consideRatio - I've been using this setup for some time and it works well. A question though:
I've always wished for a |
Does #118 Allow chartpress to be run from a different folder cover the last feature request? Is there anything else required here or can we close this? |
Let's close this and not maintain a chartpress pre-commit hook that is very easy and plausible to define locally to do whats wanted anyhow. |
I've started using
chartpress --reset
with the pre-commit package and it works very nicely to prevent accidental commits of modified chart values. It would be great to have the.pre-commit.hooks.yaml
definition as a part of chartpress so one could simply include it like any other pre-commit hook. The user of chartpress would then have a.pre-commit.config.yaml
in their repo's base directory with something like:If then you try to commit a change to the chartpress-managed values you get something like:
If you want to include something like this I'll happily contribute a PR.
The text was updated successfully, but these errors were encountered: