From 92afc2dea1407181c9e1d6cbeece86ba32fa25f1 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Wed, 29 Jan 2025 21:50:14 -0600 Subject: [PATCH] Update gitlab and renovate hooks to 'nonunicode' resolves #516, #518 --- .pre-commit-hooks.yaml | 4 ++-- CHANGELOG.rst | 3 +++ src/check_jsonschema/catalog.py | 8 +++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 54cd05833..afe8005d8 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -158,7 +158,7 @@ - id: check-gitlab-ci name: Validate GitLab CI config description: 'Validate GitLab CI config against the schema provided by SchemaStore' - entry: check-jsonschema --builtin-schema vendor.gitlab-ci --data-transform gitlab-ci + entry: check-jsonschema --builtin-schema vendor.gitlab-ci --data-transform gitlab-ci --regex-variant nonunicode language: python files: ^.*\.gitlab-ci\.yml$ types: [yaml] @@ -196,7 +196,7 @@ - id: check-renovate name: Validate Renovate Config description: 'Validate Renovate config against the schema provided by Renovate (does not support renovate config in package.json)' - entry: check-jsonschema --builtin-schema vendor.renovate + entry: check-jsonschema --builtin-schema vendor.renovate --regex-variant nonunicode language: python files: > (?x)^( diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 91c13a827..8f3c96d5f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,9 @@ Unreleased .. vendor-insert-here - Update vendored schemas (2025-01-26) +- Update the ``gitlab`` and ``renovate`` hooks to use + ``--regex-variant nonunicode``. Thanks :user:`quentin-ag` and :user:`Callek` + for reporting! (:issue:`516`, :issue:`518`) 0.31.0 ------ diff --git a/src/check_jsonschema/catalog.py b/src/check_jsonschema/catalog.py index 017ceb59b..0bedd57a1 100644 --- a/src/check_jsonschema/catalog.py +++ b/src/check_jsonschema/catalog.py @@ -156,7 +156,12 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: ), "hook_config": { "name": "Validate GitLab CI config", - "add_args": ["--data-transform", "gitlab-ci"], + "add_args": [ + "--data-transform", + "gitlab-ci", + "--regex-variant", + "nonunicode", + ], "files": r"^.*\.gitlab-ci\.yml$", "types": "yaml", }, @@ -198,6 +203,7 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: "Validate Renovate config against the schema provided by " "Renovate (does not support renovate config in package.json)" ), + "add_args": ["--regex-variant", "nonunicode"], "files": [ r"renovate\.(json|json5)", r"\.(github|gitlab)/renovate\.(json|json5)",