From 3c17834cf37d4d369034475180029112f238672d Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Sat, 26 Dec 2020 02:12:58 +0100 Subject: [PATCH] pre-commit: chartpress --reset on Chart.yaml/values.yaml changes --- .github/workflows/test.yml | 6 +++--- .pre-commit-config.yaml | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab2f4d83b2..66117098d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,14 +32,14 @@ jobs: with: python-version: '3.7' - - uses: pre-commit/action@v2.0.0 - - name: Install dependencies run: | . ci/common setup_helm KUBEVAL_VERSION=0.15.0 setup_kubeval - pip install yamllint + pip install chartpress yamllint + + - uses: pre-commit/action@v2.0.0 - name: Lint and validate # NOTE: Kubernetes resource validation can only be done against diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a3f2541eb0..532aa69c38 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,28 @@ +# pre-commit is a tool to automatically do tasks before committing. +# +# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level +# repos: + # Python code formatting - repo: https://github.com/ambv/black rev: 20.8b1 hooks: - id: black args: [--target-version=py36] + + # Shell script code formatting - repo: https://github.com/lovesegfault/beautysh rev: 6.0.1 hooks: - id: beautysh + + # Reset changes by chartpress + - repo: local + hooks: + - id: chartpress + name: chartpress --reset + files: jupyterhub/Chart.yaml|jupyterhub/values.yaml + description: Run `chartpress --reset` to clean up helm charts before committing. + entry: chartpress --reset + language: system + pass_filenames: false