From 3abc837f78a669c48879dc9afce3347f963de529 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Sat, 16 May 2026 16:28:07 +0200 Subject: [PATCH 1/6] chore: configure pre-commit stages and add build hook --- .pre-commit-config.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c8dd2d3..aeada8f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,4 @@ +default_stages: [pre-commit, pre-push, manual] exclude: ^(dist|node_modules)/ repos: - repo: https://github.com/pre-commit/pre-commit-hooks @@ -39,8 +40,18 @@ repos: rev: v6.0.0 hooks: - id: end-of-file-fixer - exclude: (.txt$|.ipynb$|README.md$|readme.mde$) + exclude: (.txt$|.ipynb$|README.md$) - id: trailing-whitespace exclude: (.txt$|README.md$) - id: mixed-line-ending args: [--fix=lf] + +- repo: local + hooks: + - id: build + name: rebuild-distribution + entry: npm run build + language: system + files: ^(index\.js|monitor\.js|package\.json|package-lock\.json)$ + pass_filenames: false + stages: [pre-commit] -- 2.52.0 From 28eb7c2971d55cc6dfa039865f83b6c76f5f47e6 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Sat, 16 May 2026 16:42:28 +0200 Subject: [PATCH 2/6] chore: remove pre-push stage from pre-commit config --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aeada8f..a51b31e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,4 @@ -default_stages: [pre-commit, pre-push, manual] +default_stages: [pre-commit, manual] exclude: ^(dist|node_modules)/ repos: - repo: https://github.com/pre-commit/pre-commit-hooks -- 2.52.0 From e5ceb46096f9abc7fe1c495497b4449fbf041e22 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Sat, 16 May 2026 16:46:06 +0200 Subject: [PATCH 3/6] chore: add stage-distribution hook to ensure dist/ is committed --- .pre-commit-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a51b31e..b7e7083 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,3 +55,10 @@ repos: files: ^(index\.js|monitor\.js|package\.json|package-lock\.json)$ pass_filenames: false stages: [pre-commit] + - id: add-dist + name: stage-distribution + entry: git add dist/ + language: system + files: ^(index\.js|monitor\.js|package\.json|package-lock\.json)$ + pass_filenames: false + stages: [pre-commit] -- 2.52.0 From 8cf0be7fff997a34d5541fafcdb163fd887af904 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Sat, 16 May 2026 16:47:27 +0200 Subject: [PATCH 4/6] chore: exclude no-commit-to-branch from manual stage --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7e7083..d04752f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,7 @@ repos: args: [--autofix, --no-sort-keys, --no-ensure-ascii] - id: check-merge-conflict - id: no-commit-to-branch + stages: [pre-commit] - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v2.16.0 -- 2.52.0 From d674506e497dd2958ad391794d33e3c85041212b Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Sat, 16 May 2026 16:49:29 +0200 Subject: [PATCH 5/6] chore: set github action/workflow checks to manual stage --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d04752f..11486b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,7 +35,9 @@ repos: hooks: - id: check-renovate - id: check-github-actions + stages: [manual] - id: check-github-workflows + stages: [manual] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 -- 2.52.0 From 1aea1ba3b1ef672595990d68c409e9b7e11a9402 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Sat, 16 May 2026 16:52:17 +0200 Subject: [PATCH 6/6] chore: update lint workflow to include manual stage hooks --- .gitea/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml index 49a1e36..cfb67d9 100644 --- a/.gitea/workflows/lint.yaml +++ b/.gitea/workflows/lint.yaml @@ -14,5 +14,5 @@ jobs: - run: pip install pre-commit shell: bash - name: Pre Commit - run: SKIP=no-commit-to-branch pre-commit run -a + run: SKIP=no-commit-to-branch pre-commit run -a --hook-stage pre-commit --hook-stage manual shell: bash -- 2.52.0