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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c8dd2d3..11486b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,4 @@ +default_stages: [pre-commit, manual] exclude: ^(dist|node_modules)/ repos: - repo: https://github.com/pre-commit/pre-commit-hooks @@ -15,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 @@ -33,14 +35,33 @@ 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 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] + - 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]