From 7bbe4cf1e204b5491879ccfd29e870a28c669a05 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:07:07 -0600 Subject: [PATCH 01/29] [pre-commit.ci] pre-commit autoupdate (#514) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.31.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.30.0...0.31.0) * Set self-check of azure-pipelines to nonunicode This is the only schema (to date) which provides an invalid regex under unicode-mode evaluation. Tweak the metaschema check to agree with it. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Stephen Rosen --- .pre-commit-config.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b523ee613..4eede38f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # dogfood - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.30.0 + rev: 0.31.0 hooks: - id: check-dependabot - id: check-github-workflows @@ -9,6 +9,11 @@ repos: - id: check-metaschema name: Validate Vendored Schemas files: ^src/check_jsonschema/builtin_schemas/vendor/.*\.json$ + exclude: ^src/check_jsonschema/builtin_schemas/vendor/azure-pipelines\.json$ + - id: check-metaschema + name: Validate Vendored Schemas (nonunicode regexes) + files: ^src/check_jsonschema/builtin_schemas/vendor/azure-pipelines\.json$ + args: ["--regex-variant", "nonunicode"] - id: check-jsonschema name: Validate Test Configs args: ["--schemafile", "tests/example-files/config_schema.json"] From 0c68edf9c9fe4a4a48e50741b0a36681645bea37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Mon, 13 Jan 2025 22:05:39 -0600 Subject: [PATCH 02/29] Add Compose Spec schema and pre-commit hook --- .pre-commit-hooks.yaml | 15 + docs/precommit_usage.rst | 14 + docs/usage.rst | 1 + .../builtin_schemas/vendor/compose-spec.json | 1024 +++++++++++++++++ .../vendor/licenses/LICENSE.compose-spec | 191 +++ .../vendor/sha256/compose-spec.sha256 | 1 + src/check_jsonschema/catalog.py | 16 + tests/acceptance/test_hook_file_matches.py | 16 + 8 files changed, 1278 insertions(+) create mode 100644 src/check_jsonschema/builtin_schemas/vendor/compose-spec.json create mode 100644 src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.compose-spec create mode 100644 src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 6f0e0e09c..54cd05833 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -89,6 +89,21 @@ files: ^cloudbuild\.(yml|yaml|json)$ types_or: [json,yaml] +# this hook is autogenerated from a script +# to modify this hook, update `src/check_jsonschema/catalog.py` +# and run `make generate-hooks` or `tox run -e generate-hooks-config` +- id: check-compose-spec + name: Validate Docker Compose files + description: 'Validate Docker Compose files against the schema provided by SchemaStore' + entry: check-jsonschema --builtin-schema vendor.compose-spec + language: python + files: > + (?x)^( + ([^/]*/)*docker-compose(\.[\.a-zA-Z0-9_-]*)*\.(yml|yaml)| + ([^/]*/)*compose(\.[\.a-zA-Z0-9_-]*)*\.(yml|yaml) + )$ + types: [yaml] + # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` # and run `make generate-hooks` or `tox run -e generate-hooks-config` diff --git a/docs/precommit_usage.rst b/docs/precommit_usage.rst index e24836e07..de58f08fa 100644 --- a/docs/precommit_usage.rst +++ b/docs/precommit_usage.rst @@ -127,6 +127,20 @@ Validate Google Cloud Build config against the schema provided by SchemaStore - id: check-cloudbuild +``check-compose-spec`` +~~~~~~~~~~~~~~~~~~~~~~ + +Validate Docker Compose files against the schema provided by SchemaStore + +.. code-block:: yaml + :caption: example config + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.31.0 + hooks: + - id: check-compose-spec + + ``check-dependabot`` ~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/usage.rst b/docs/usage.rst index 7de004e75..b5955d55c 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -92,6 +92,7 @@ SchemaStore and other sources: - ``vendor.buildkite`` - ``vendor.circle-ci`` - ``vendor.cloudbuild`` +- ``vendor.compose-spec`` - ``vendor.dependabot`` - ``vendor.drone-ci`` - ``vendor.github-actions`` diff --git a/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json b/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json new file mode 100644 index 000000000..f95a7b9db --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json @@ -0,0 +1,1024 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema#", + "id": "compose_spec.json", + "type": "object", + "title": "Compose Specification", + "description": "The Compose file is a YAML file defining a multi-containers based application.", + + "properties": { + "version": { + "type": "string", + "description": "declared for backward compatibility, ignored." + }, + + "name": { + "type": "string", + "description": "define the Compose project name, until user defines one explicitly." + }, + + "include": { + "type": "array", + "items": { + "$ref": "#/definitions/include" + }, + "description": "compose sub-projects to be included." + }, + + "services": { + "id": "#/properties/services", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/service" + } + }, + "additionalProperties": false + }, + + "networks": { + "id": "#/properties/networks", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/network" + } + } + }, + + "volumes": { + "id": "#/properties/volumes", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/volume" + } + }, + "additionalProperties": false + }, + + "secrets": { + "id": "#/properties/secrets", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/secret" + } + }, + "additionalProperties": false + }, + + "configs": { + "id": "#/properties/configs", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/config" + } + }, + "additionalProperties": false + } + }, + + "patternProperties": {"^x-": {}}, + "additionalProperties": false, + + "definitions": { + + "service": { + "id": "#/definitions/service", + "type": "object", + + "properties": { + "develop": {"$ref": "#/definitions/development"}, + "deploy": {"$ref": "#/definitions/deployment"}, + "annotations": {"$ref": "#/definitions/list_or_dict"}, + "attach": {"type": ["boolean", "string"]}, + "build": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "properties": { + "context": {"type": "string"}, + "dockerfile": {"type": "string"}, + "dockerfile_inline": {"type": "string"}, + "entitlements": {"type": "array", "items": {"type": "string"}}, + "args": {"$ref": "#/definitions/list_or_dict"}, + "ssh": {"$ref": "#/definitions/list_or_dict"}, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "cache_from": {"type": "array", "items": {"type": "string"}}, + "cache_to": {"type": "array", "items": {"type": "string"}}, + "no_cache": {"type": ["boolean", "string"]}, + "additional_contexts": {"$ref": "#/definitions/list_or_dict"}, + "network": {"type": "string"}, + "pull": {"type": ["boolean", "string"]}, + "target": {"type": "string"}, + "shm_size": {"type": ["integer", "string"]}, + "extra_hosts": {"$ref": "#/definitions/extra_hosts"}, + "isolation": {"type": "string"}, + "privileged": {"type": ["boolean", "string"]}, + "secrets": {"$ref": "#/definitions/service_config_or_secret"}, + "tags": {"type": "array", "items": {"type": "string"}}, + "ulimits": {"$ref": "#/definitions/ulimits"}, + "platforms": {"type": "array", "items": {"type": "string"}} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + }, + "blkio_config": { + "type": "object", + "properties": { + "device_read_bps": { + "type": "array", + "items": {"$ref": "#/definitions/blkio_limit"} + }, + "device_read_iops": { + "type": "array", + "items": {"$ref": "#/definitions/blkio_limit"} + }, + "device_write_bps": { + "type": "array", + "items": {"$ref": "#/definitions/blkio_limit"} + }, + "device_write_iops": { + "type": "array", + "items": {"$ref": "#/definitions/blkio_limit"} + }, + "weight": {"type": ["integer", "string"]}, + "weight_device": { + "type": "array", + "items": {"$ref": "#/definitions/blkio_weight"} + } + }, + "additionalProperties": false + }, + "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "cgroup": {"type": "string", "enum": ["host", "private"]}, + "cgroup_parent": {"type": "string"}, + "command": {"$ref": "#/definitions/command"}, + "configs": {"$ref": "#/definitions/service_config_or_secret"}, + "container_name": {"type": "string"}, + "cpu_count": {"oneOf": [ + {"type": "string"}, + {"type": "integer", "minimum": 0} + ]}, + "cpu_percent": {"oneOf": [ + {"type": "string"}, + {"type": "integer", "minimum": 0, "maximum": 100} + ]}, + "cpu_shares": {"type": ["number", "string"]}, + "cpu_quota": {"type": ["number", "string"]}, + "cpu_period": {"type": ["number", "string"]}, + "cpu_rt_period": {"type": ["number", "string"]}, + "cpu_rt_runtime": {"type": ["number", "string"]}, + "cpus": {"type": ["number", "string"]}, + "cpuset": {"type": "string"}, + "credential_spec": { + "type": "object", + "properties": { + "config": {"type": "string"}, + "file": {"type": "string"}, + "registry": {"type": "string"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "depends_on": { + "oneOf": [ + {"$ref": "#/definitions/list_of_strings"}, + { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "type": "object", + "additionalProperties": false, + "patternProperties": {"^x-": {}}, + "properties": { + "restart": {"type": ["boolean", "string"]}, + "required": { + "type": "boolean", + "default": true + }, + "condition": { + "type": "string", + "enum": ["service_started", "service_healthy", "service_completed_successfully"] + } + }, + "required": ["condition"] + } + } + } + ] + }, + "device_cgroup_rules": {"$ref": "#/definitions/list_of_strings"}, + "devices": { + "type": "array", + "items": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "required": ["source"], + "properties": { + "source": {"type": "string"}, + "target": {"type": "string"}, + "permissions": {"type": "string"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + } + }, + "dns": {"$ref": "#/definitions/string_or_list"}, + "dns_opt": {"type": "array","items": {"type": "string"}, "uniqueItems": true}, + "dns_search": {"$ref": "#/definitions/string_or_list"}, + "domainname": {"type": "string"}, + "entrypoint": {"$ref": "#/definitions/command"}, + "env_file": {"$ref": "#/definitions/env_file"}, + "label_file": {"$ref": "#/definitions/label_file"}, + "environment": {"$ref": "#/definitions/list_or_dict"}, + + "expose": { + "type": "array", + "items": { + "type": ["string", "number"], + "format": "expose" + }, + "uniqueItems": true + }, + "extends": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + + "properties": { + "service": {"type": "string"}, + "file": {"type": "string"} + }, + "required": ["service"], + "additionalProperties": false + } + ] + }, + "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "extra_hosts": {"$ref": "#/definitions/extra_hosts"}, + "gpus": {"$ref": "#/definitions/gpus"}, + "group_add": { + "type": "array", + "items": { + "type": ["string", "number"] + }, + "uniqueItems": true + }, + "healthcheck": {"$ref": "#/definitions/healthcheck"}, + "hostname": {"type": "string"}, + "image": {"type": "string"}, + "init": {"type": ["boolean", "string"]}, + "ipc": {"type": "string"}, + "isolation": {"type": "string"}, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "logging": { + "type": "object", + + "properties": { + "driver": {"type": "string"}, + "options": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number", "null"]} + } + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "mac_address": {"type": "string"}, + "mem_limit": {"type": ["number", "string"]}, + "mem_reservation": {"type": ["string", "integer"]}, + "mem_swappiness": {"type": ["integer", "string"]}, + "memswap_limit": {"type": ["number", "string"]}, + "network_mode": {"type": "string"}, + "networks": { + "oneOf": [ + {"$ref": "#/definitions/list_of_strings"}, + { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "oneOf": [ + { + "type": "object", + "properties": { + "aliases": {"$ref": "#/definitions/list_of_strings"}, + "ipv4_address": {"type": "string"}, + "ipv6_address": {"type": "string"}, + "link_local_ips": {"$ref": "#/definitions/list_of_strings"}, + "mac_address": {"type": "string"}, + "driver_opts": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "priority": {"type": "number"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + {"type": "null"} + ] + } + }, + "additionalProperties": false + } + ] + }, + "oom_kill_disable": {"type": ["boolean", "string"]}, + "oom_score_adj": {"oneOf": [ + {"type": "string"}, + {"type": "integer", "minimum": -1000, "maximum": 1000} + ]}, + "pid": {"type": ["string", "null"]}, + "pids_limit": {"type": ["number", "string"]}, + "platform": {"type": "string"}, + "ports": { + "type": "array", + "items": { + "oneOf": [ + {"type": "number"}, + {"type": "string"}, + { + "type": "object", + "properties": { + "name": {"type": "string"}, + "mode": {"type": "string"}, + "host_ip": {"type": "string"}, + "target": {"type": ["integer", "string"]}, + "published": {"type": ["string", "integer"]}, + "protocol": {"type": "string"}, + "app_protocol": {"type": "string"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + }, + "uniqueItems": true + }, + "post_start": {"type": "array", "items": {"$ref": "#/definitions/service_hook"}}, + "pre_stop": {"type": "array", "items": {"$ref": "#/definitions/service_hook"}}, + "privileged": {"type": ["boolean", "string"]}, + "profiles": {"$ref": "#/definitions/list_of_strings"}, + "pull_policy": {"type": "string", "enum": [ + "always", "never", "if_not_present", "build", "missing" + ]}, + "read_only": {"type": ["boolean", "string"]}, + "restart": {"type": "string"}, + "runtime": { + "type": "string" + }, + "scale": { + "type": ["integer", "string"] + }, + "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "shm_size": {"type": ["number", "string"]}, + "secrets": {"$ref": "#/definitions/service_config_or_secret"}, + "sysctls": {"$ref": "#/definitions/list_or_dict"}, + "stdin_open": {"type": ["boolean", "string"]}, + "stop_grace_period": {"type": "string"}, + "stop_signal": {"type": "string"}, + "storage_opt": {"type": "object"}, + "tmpfs": {"$ref": "#/definitions/string_or_list"}, + "tty": {"type": ["boolean", "string"]}, + "ulimits": {"$ref": "#/definitions/ulimits"}, + "user": {"type": "string"}, + "uts": {"type": "string"}, + "userns_mode": {"type": "string"}, + "volumes": { + "type": "array", + "items": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "required": ["type"], + "properties": { + "type": {"type": "string"}, + "source": {"type": "string"}, + "target": {"type": "string"}, + "read_only": {"type": ["boolean", "string"]}, + "consistency": {"type": "string"}, + "bind": { + "type": "object", + "properties": { + "propagation": {"type": "string"}, + "create_host_path": {"type": ["boolean", "string"]}, + "recursive": {"type": "string", "enum": ["enabled", "disabled", "writable", "readonly"]}, + "selinux": {"type": "string", "enum": ["z", "Z"]} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "volume": { + "type": "object", + "properties": { + "nocopy": {"type": ["boolean", "string"]}, + "subpath": {"type": "string"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "tmpfs": { + "type": "object", + "properties": { + "size": { + "oneOf": [ + {"type": "integer", "minimum": 0}, + {"type": "string"} + ] + }, + "mode": {"type": ["number", "string"]} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + }, + "uniqueItems": true + }, + "volumes_from": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + }, + "working_dir": {"type": "string"} + }, + "patternProperties": {"^x-": {}}, + "additionalProperties": false + }, + + "healthcheck": { + "id": "#/definitions/healthcheck", + "type": "object", + "properties": { + "disable": {"type": ["boolean", "string"]}, + "interval": {"type": "string"}, + "retries": {"type": ["number", "string"]}, + "test": { + "oneOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}} + ] + }, + "timeout": {"type": "string"}, + "start_period": {"type": "string"}, + "start_interval": {"type": "string"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "development": { + "id": "#/definitions/development", + "type": ["object", "null"], + "properties": { + "watch": { + "type": "array", + "items": { + "type": "object", + "required": ["path", "action"], + "properties": { + "ignore": {"type": "array", "items": {"type": "string"}}, + "path": {"type": "string"}, + "action": {"type": "string", "enum": ["rebuild", "sync", "restart", "sync+restart", "sync+exec"]}, + "target": {"type": "string"}, + "exec": {"$ref": "#/definitions/service_hook"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "deployment": { + "id": "#/definitions/deployment", + "type": ["object", "null"], + "properties": { + "mode": {"type": "string"}, + "endpoint_mode": {"type": "string"}, + "replicas": {"type": ["integer", "string"]}, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "rollback_config": { + "type": "object", + "properties": { + "parallelism": {"type": ["integer", "string"]}, + "delay": {"type": "string"}, + "failure_action": {"type": "string"}, + "monitor": {"type": "string"}, + "max_failure_ratio": {"type": ["number", "string"]}, + "order": {"type": "string", "enum": [ + "start-first", "stop-first" + ]} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "update_config": { + "type": "object", + "properties": { + "parallelism": {"type": ["integer", "string"]}, + "delay": {"type": "string"}, + "failure_action": {"type": "string"}, + "monitor": {"type": "string"}, + "max_failure_ratio": {"type": ["number", "string"]}, + "order": {"type": "string", "enum": [ + "start-first", "stop-first" + ]} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "resources": { + "type": "object", + "properties": { + "limits": { + "type": "object", + "properties": { + "cpus": {"type": ["number", "string"]}, + "memory": {"type": "string"}, + "pids": {"type": ["integer", "string"]} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "reservations": { + "type": "object", + "properties": { + "cpus": {"type": ["number", "string"]}, + "memory": {"type": "string"}, + "generic_resources": {"$ref": "#/definitions/generic_resources"}, + "devices": {"$ref": "#/definitions/devices"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "restart_policy": { + "type": "object", + "properties": { + "condition": {"type": "string"}, + "delay": {"type": "string"}, + "max_attempts": {"type": ["integer", "string"]}, + "window": {"type": "string"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "placement": { + "type": "object", + "properties": { + "constraints": {"type": "array", "items": {"type": "string"}}, + "preferences": { + "type": "array", + "items": { + "type": "object", + "properties": { + "spread": {"type": "string"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "max_replicas_per_node": {"type": ["integer", "string"]} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "generic_resources": { + "id": "#/definitions/generic_resources", + "type": "array", + "items": { + "type": "object", + "properties": { + "discrete_resource_spec": { + "type": "object", + "properties": { + "kind": {"type": "string"}, + "value": {"type": ["number", "string"]} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + + "devices": { + "id": "#/definitions/devices", + "type": "array", + "items": { + "type": "object", + "properties": { + "capabilities": {"$ref": "#/definitions/list_of_strings"}, + "count": {"type": ["string", "integer"]}, + "device_ids": {"$ref": "#/definitions/list_of_strings"}, + "driver":{"type": "string"}, + "options":{"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}}, + "required": [ + "capabilities" + ] + } + }, + + "gpus": { + "id": "#/definitions/gpus", + "type": "array", + "items": { + "type": "object", + "properties": { + "capabilities": {"$ref": "#/definitions/list_of_strings"}, + "count": {"type": ["string", "integer"]}, + "device_ids": {"$ref": "#/definitions/list_of_strings"}, + "driver":{"type": "string"}, + "options":{"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + + "include": { + "id": "#/definitions/include", + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "properties": { + "path": {"$ref": "#/definitions/string_or_list"}, + "env_file": {"$ref": "#/definitions/string_or_list"}, + "project_directory": {"type": "string"} + }, + "additionalProperties": false + } + ] + }, + + "network": { + "id": "#/definitions/network", + "type": ["object", "null"], + "properties": { + "name": {"type": "string"}, + "driver": {"type": "string"}, + "driver_opts": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "ipam": { + "type": "object", + "properties": { + "driver": {"type": "string"}, + "config": { + "type": "array", + "items": { + "type": "object", + "properties": { + "subnet": {"type": "string"}, + "ip_range": {"type": "string"}, + "gateway": {"type": "string"}, + "aux_addresses": { + "type": "object", + "additionalProperties": false, + "patternProperties": {"^.+$": {"type": "string"}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + }, + "options": { + "type": "object", + "additionalProperties": false, + "patternProperties": {"^.+$": {"type": "string"}} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "external": { + "type": ["boolean", "string", "object"], + "properties": { + "name": { + "deprecated": true, + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "internal": {"type": ["boolean", "string"]}, + "enable_ipv6": {"type": ["boolean", "string"]}, + "attachable": {"type": ["boolean", "string"]}, + "labels": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "volume": { + "id": "#/definitions/volume", + "type": ["object", "null"], + "properties": { + "name": {"type": "string"}, + "driver": {"type": "string"}, + "driver_opts": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "external": { + "type": ["boolean", "string", "object"], + "properties": { + "name": { + "deprecated": true, + "type": "string" + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + "labels": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "secret": { + "id": "#/definitions/secret", + "type": "object", + "properties": { + "name": {"type": "string"}, + "environment": {"type": "string"}, + "file": {"type": "string"}, + "external": { + "type": ["boolean", "string", "object"], + "properties": { + "name": {"type": "string"} + } + }, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "driver": {"type": "string"}, + "driver_opts": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "template_driver": {"type": "string"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "config": { + "id": "#/definitions/config", + "type": "object", + "properties": { + "name": {"type": "string"}, + "content": {"type": "string"}, + "environment": {"type": "string"}, + "file": {"type": "string"}, + "external": { + "type": ["boolean", "string", "object"], + "properties": { + "name": { + "deprecated": true, + "type": "string" + } + } + }, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "template_driver": {"type": "string"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "command": { + "oneOf": [ + {"type": "null"}, + {"type": "string"}, + {"type": "array","items": {"type": "string"}} + ] + }, + + "service_hook": { + "id": "#/definitions/service_hook", + "type": "object", + "properties": { + "command": {"$ref": "#/definitions/command"}, + "user": {"type": "string"}, + "privileged": {"type": ["boolean", "string"]}, + "working_dir": {"type": "string"}, + "environment": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + }, + + "env_file": { + "oneOf": [ + {"type": "string"}, + { + "type": "array", + "items": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "additionalProperties": false, + "properties": { + "path": { + "type": "string" + }, + "format": { + "type": "string" + }, + "required": { + "type": ["boolean", "string"], + "default": true + } + }, + "required": [ + "path" + ] + } + ] + } + } + ] + }, + + "label_file": { + "oneOf": [ + {"type": "string"}, + { + "type": "array", + "items": {"type": "string"} + } + ] + }, + + "string_or_list": { + "oneOf": [ + {"type": "string"}, + {"$ref": "#/definitions/list_of_strings"} + ] + }, + + "list_of_strings": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + }, + + "list_or_dict": { + "oneOf": [ + { + "type": "object", + "patternProperties": { + ".+": { + "type": ["string", "number", "boolean", "null"] + } + }, + "additionalProperties": false + }, + {"type": "array", "items": {"type": "string"}, "uniqueItems": true} + ] + }, + + "extra_hosts": { + "oneOf": [ + { + "type": "object", + "patternProperties": { + ".+": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": false + } + ] + } + }, + "additionalProperties": false + }, + {"type": "array", "items": {"type": "string"}, "uniqueItems": true} + ] + }, + + "blkio_limit": { + "type": "object", + "properties": { + "path": {"type": "string"}, + "rate": {"type": ["integer", "string"]} + }, + "additionalProperties": false + }, + "blkio_weight": { + "type": "object", + "properties": { + "path": {"type": "string"}, + "weight": {"type": ["integer", "string"]} + }, + "additionalProperties": false + }, + "service_config_or_secret": { + "type": "array", + "items": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "properties": { + "source": {"type": "string"}, + "target": {"type": "string"}, + "uid": {"type": "string"}, + "gid": {"type": "string"}, + "mode": {"type": ["number", "string"]} + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + } + }, + "ulimits": { + "type": "object", + "patternProperties": { + "^[a-z]+$": { + "oneOf": [ + {"type": ["integer", "string"]}, + { + "type": "object", + "properties": { + "hard": {"type": ["integer", "string"]}, + "soft": {"type": ["integer", "string"]} + }, + "required": ["soft", "hard"], + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] + } + } + }, + "constraints": { + "service": { + "id": "#/definitions/constraints/service", + "anyOf": [ + {"required": ["build"]}, + {"required": ["image"]} + ], + "properties": { + "build": { + "required": ["context"] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.compose-spec b/src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.compose-spec new file mode 100644 index 000000000..6d8d58fb6 --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.compose-spec @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2013-2018 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 new file mode 100644 index 000000000..cdfa4616e --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 @@ -0,0 +1 @@ +e145038bdb404f2cf6d3eca3bf9b62434afcd7f7bea1ee611a1ff41d3b44ce68 \ No newline at end of file diff --git a/src/check_jsonschema/catalog.py b/src/check_jsonschema/catalog.py index cebbd78a5..017ceb59b 100644 --- a/src/check_jsonschema/catalog.py +++ b/src/check_jsonschema/catalog.py @@ -98,6 +98,22 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: "types_or": ["json", "yaml"], }, }, + "compose-spec": { + "url": _githubusercontent_url( + "compose-spec", + "compose-spec", + "master", + "schema/compose-spec.json", + ), + "hook_config": { + "name": "Validate Docker Compose files", + "files": [ + r"([^/]*/)*docker-compose(\.[\.a-zA-Z0-9_-]*)*\.(yml|yaml)", + r"([^/]*/)*compose(\.[\.a-zA-Z0-9_-]*)*\.(yml|yaml)", + ], + "types": "yaml", + }, + }, "dependabot": { "url": "https://json.schemastore.org/dependabot-2.0.json", "hook_config": { diff --git a/tests/acceptance/test_hook_file_matches.py b/tests/acceptance/test_hook_file_matches.py index 59e9ebafa..d6660122c 100644 --- a/tests/acceptance/test_hook_file_matches.py +++ b/tests/acceptance/test_hook_file_matches.py @@ -63,6 +63,22 @@ def get_hook_config(hookid): "bamboo-specs/README.md", ), }, + "check-compose-spec": { + "good": ( + "compose.yml", + "compose.yaml", + "docker-compose.yml", + "docker-compose.yaml", + "compose.override.yml", + "docker-compose.override.yml", + "path/to/compose.yml", + ), + "bad": ( + "docker.compose.yml", + "docker.md", + "Dockerfile", + ), + }, "check-dependabot": { "good": (".github/dependabot.yml", ".github/dependabot.yaml"), "bad": (".dependabot.yaml", ".dependabot.yml"), From df2b36209e66985f2545ab0eeb07fecab52d610a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 26 Jan 2025 09:00:55 -0600 Subject: [PATCH 03/29] [vendor-schemas] automated update (#517) Co-authored-by: sirosen <1300022+sirosen@users.noreply.github.com> --- CHANGELOG.rst | 2 + .../builtin_schemas/vendor/buildkite.json | 28 ++--------- .../builtin_schemas/vendor/cloudbuild.json | 46 +++++++++++++++++++ .../builtin_schemas/vendor/compose-spec.json | 31 +++++++------ .../builtin_schemas/vendor/mergify.json | 16 ++++++- .../builtin_schemas/vendor/renovate.json | 39 ++++++++++------ .../vendor/sha256/buildkite.sha256 | 2 +- .../vendor/sha256/cloudbuild.sha256 | 2 +- .../vendor/sha256/compose-spec.sha256 | 2 +- .../vendor/sha256/mergify.sha256 | 2 +- .../vendor/sha256/renovate.sha256 | 2 +- 11 files changed, 114 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7f6db5d9e..91c13a827 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,8 @@ Unreleased .. vendor-insert-here +- Update vendored schemas (2025-01-26) + 0.31.0 ------ diff --git a/src/check_jsonschema/builtin_schemas/vendor/buildkite.json b/src/check_jsonschema/builtin_schemas/vendor/buildkite.json index f2d23824c..7b0563cd8 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/buildkite.json +++ b/src/check_jsonschema/builtin_schemas/vendor/buildkite.json @@ -321,16 +321,7 @@ "type": "object", "properties": { "github_check": { - "type": "object", - "properties": { - "context": { - "description": "GitHub commit status name", - "type": "string" - } - } - }, - "if": { - "$ref": "#/definitions/if" + "type": "object" } }, "additionalProperties": false @@ -954,16 +945,7 @@ "type": "object", "properties": { "github_check": { - "type": "object", - "properties": { - "context": { - "description": "GitHub commit status name", - "type": "string" - } - } - }, - "if": { - "$ref": "#/definitions/if" + "type": "object" } }, "additionalProperties": false @@ -1000,7 +982,8 @@ }, { "type": "object", - "description": "A map of plugins for this step. Deprecated: please use the array syntax." + "description": "A map of plugins for this step. Deprecated: please use the array syntax.", + "deprecated": true } ] }, @@ -1152,9 +1135,6 @@ "wait": { "description": "Waits for previous steps to pass before continuing", "type": ["string", "null"] - }, - "waiter": { - "type": ["string", "null"] } }, "additionalProperties": false diff --git a/src/check_jsonschema/builtin_schemas/vendor/cloudbuild.json b/src/check_jsonschema/builtin_schemas/vendor/cloudbuild.json index 25c2211b5..8a5304164 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/cloudbuild.json +++ b/src/check_jsonschema/builtin_schemas/vendor/cloudbuild.json @@ -283,6 +283,13 @@ "description": "A list of objects to be uploaded to Cloud Storage upon successful completion of all build steps. Files in the workspace matching specified paths globs will be uploaded to the specified Cloud Storage location using the builder service account's credentials. The location and generation of the uploaded objects will be stored in the Build resource's results field. If any objects fail to be pushed, the build is marked FAILURE.", "markdownDescription": "A list of objects to be uploaded to Cloud Storage upon successful completion of all build steps. Files in the workspace matching specified paths globs will be uploaded to the specified Cloud Storage location using the builder service account's credentials. The location and generation of the uploaded objects will be stored in the Build resource's results field. If any objects fail to be pushed, the build is marked `FAILURE`." }, + "goModules": { + "description": "Allows you to upload non-container Go modules to Go repositories in Artifact Registry.", + "type": "array", + "items": { + "$ref": "#/definitions/GoModules" + } + }, "mavenArtifacts": { "description": "Allows you to upload non-container Java artifacts to Maven repositories in Artifact Registry.", "type": "array", @@ -324,6 +331,45 @@ } } }, + "GoModules": { + "description": "Allows you to upload non-container Go modules to Go repositories in Artifact Registry.", + "type": "object", + "additionalProperties": false, + "properties": { + "repositoryName": { + "description": "The name of your Go repository in Artifact Registry.", + "type": "string" + }, + "repositoryLocation": { + "description": "The location for your repository in Artifact Registry.", + "type": "string" + }, + "repositoryProject_id": { + "description": "The ID of the Google Cloud project that contains your Artifact Registry Go repository.", + "type": "string" + }, + "sourcePath": { + "description": "The path to the go.mod file in the build's workspace.", + "type": "string" + }, + "modulePath": { + "description": "The local directory that contains the Go module to upload. It is recommended to use an absolute path for the value.", + "type": "string" + }, + "moduleVersion": { + "description": "The version of the Go module.", + "type": "string" + } + }, + "required": [ + "repositoryName", + "repositoryLocation", + "repositoryProject_id", + "sourcePath", + "modulePath", + "moduleVersion" + ] + }, "MavenArtifacts": { "description": "Allows you to upload non-container Java artifacts to Maven repositories in Artifact Registry.", "type": "object", diff --git a/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json b/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json index f95a7b9db..bfaa72dbc 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json +++ b/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json @@ -657,19 +657,23 @@ "gpus": { "id": "#/definitions/gpus", - "type": "array", - "items": { - "type": "object", - "properties": { - "capabilities": {"$ref": "#/definitions/list_of_strings"}, - "count": {"type": ["string", "integer"]}, - "device_ids": {"$ref": "#/definitions/list_of_strings"}, - "driver":{"type": "string"}, - "options":{"$ref": "#/definitions/list_or_dict"} - }, - "additionalProperties": false, - "patternProperties": {"^x-": {}} - } + "oneOf": [ + {"type": "string", "enum": ["all"]}, + {"type": "array", + "items": { + "type": "object", + "properties": { + "capabilities": {"$ref": "#/definitions/list_of_strings"}, + "count": {"type": ["string", "integer"]}, + "device_ids": {"$ref": "#/definitions/list_of_strings"}, + "driver":{"type": "string"}, + "options":{"$ref": "#/definitions/list_or_dict"} + } + }, + "additionalProperties": false, + "patternProperties": {"^x-": {}} + } + ] }, "include": { @@ -743,6 +747,7 @@ "patternProperties": {"^x-": {}} }, "internal": {"type": ["boolean", "string"]}, + "enable_ipv4": {"type": ["boolean", "string"]}, "enable_ipv6": {"type": ["boolean", "string"]}, "attachable": {"type": ["boolean", "string"]}, "labels": {"$ref": "#/definitions/list_or_dict"} diff --git a/src/check_jsonschema/builtin_schemas/vendor/mergify.json b/src/check_jsonschema/builtin_schemas/vendor/mergify.json index 3745006d4..b341bff6e 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/mergify.json +++ b/src/check_jsonschema/builtin_schemas/vendor/mergify.json @@ -1553,9 +1553,21 @@ "type": "boolean" }, "branch-protection-review-decision": { + "anyOf": [ + { + "enum": [ + "APPROVED", + "CHANGES_REQUESTED", + "REVIEW_REQUIRED" + ], + "type": "string" + }, + { + "type": "null" + } + ], "description": "The review decision. This indicates if `CODEOWNERS` have reviewed the pull request when the `Require Review from Code Owners` branch protection rule is enabled.", - "title": "Branch protection review decision", - "type": "boolean" + "title": "Branch protection review decision" }, "queue-frozen": { "description": "Whether the pull request is in a queue that is frozen.", diff --git a/src/check_jsonschema/builtin_schemas/vendor/renovate.json b/src/check_jsonschema/builtin_schemas/vendor/renovate.json index dd5814cd7..a9f02f44c 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/renovate.json +++ b/src/check_jsonschema/builtin_schemas/vendor/renovate.json @@ -22,6 +22,11 @@ "type": "string" } }, + "allowCommandTemplating": { + "description": "Set this to `false` to disable template compilation for post-upgrade commands.", + "type": "boolean", + "default": true + }, "allowCustomCrateRegistries": { "description": "Set this to `true` to allow custom crate registries.", "type": "boolean", @@ -32,16 +37,19 @@ "type": "boolean", "default": false }, - "allowPostUpgradeCommandTemplating": { - "description": "Set this to `false` to disable template compilation for post-upgrade commands.", - "type": "boolean", - "default": true - }, "allowScripts": { "description": "Set this to `true` if repositories are allowed to run install scripts.", "type": "boolean", "default": false }, + "allowedCommands": { + "description": "A list of regular expressions that decide which commands are allowed in post-upgrade tasks.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, "allowedEnv": { "description": "List of allowed patterns for environment variable names in repository env config.", "type": "array", @@ -60,14 +68,6 @@ "X-*" ] }, - "allowedPostUpgradeCommands": { - "description": "A list of regular expressions that decide which post-upgrade tasks are allowed.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, "ansible": { "description": "Configuration object for the ansible manager", "type": "object", @@ -1072,7 +1072,7 @@ "dockerSidecarImage": { "description": "Change this value to override the default Renovate sidecar image.", "type": "string", - "default": "ghcr.io/containerbase/sidecar:13.5.8" + "default": "ghcr.io/containerbase/sidecar:13.7.1" }, "dockerUser": { "description": "Set the `UID` and `GID` for Docker-based binaries if you use `binarySource=docker`.", @@ -1521,6 +1521,17 @@ ], "default": null }, + "haskell-cabal": { + "description": "Configuration object for the haskell-cabal manager", + "type": "object", + "default": { + "fileMatch": [ + "\\.cabal$" + ], + "pinDigests": false + }, + "$ref": "#" + }, "helm-requirements": { "description": "Configuration object for the helm-requirements manager", "type": "object", diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/buildkite.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/buildkite.sha256 index 532cf89f0..d6ed613fb 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/buildkite.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/buildkite.sha256 @@ -1 +1 @@ -761ceff545736b65fabe577b8e7d06ceb5baa9d339f8faa0192cd3c3d85d5a11 \ No newline at end of file +128a96e0088b34eb6c1bd591df82a32e1e6743a4bd7c38fc0f5819b2e1ef831a \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/cloudbuild.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/cloudbuild.sha256 index fd3cc543e..a6e8c16ee 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/cloudbuild.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/cloudbuild.sha256 @@ -1 +1 @@ -10abf844b1f912e9798b5db134390d06289f756f6116d2435be3475c86b8205c \ No newline at end of file +e2444a4bcf66bdb777f954ff294800c94d1f1a54cf1104d2600d6bded0dd5b3b \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 index cdfa4616e..d2752d3d3 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 @@ -1 +1 @@ -e145038bdb404f2cf6d3eca3bf9b62434afcd7f7bea1ee611a1ff41d3b44ce68 \ No newline at end of file +91ae91d24640d45634c9d4b5f4e3a5ce1b6b6da38bc06b27e2a04891f81f32da \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 index 2b05ccd37..3cadce6db 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 @@ -1 +1 @@ -d2afb9ba1f220ce421931d064c71a366e4e2c96f08bcb59e26d6b0c554cf21ba \ No newline at end of file +898c7fc37bca50fd7b79b4181e59a4485051c3cd30412200bdfdd7351848f963 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 index 463e2b100..276cb6555 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 @@ -1 +1 @@ -881689db799388cfc85d84bd89f565d69dd0869c0dfc60b83096252216980999 \ No newline at end of file +86655aecc05722842a57425aee1c82c6cfb120fe919940298355e72163c76e8e \ No newline at end of file From 409bab5340fc6f2e695e1696e38e1bdccca8602e Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Wed, 29 Jan 2025 22:06:00 -0600 Subject: [PATCH 04/29] Update gitlab and renovate hooks to 'nonunicode' (#519) 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)", From 8b64e8da8f8376a7590b877acf23edd40ac0b0aa Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Wed, 29 Jan 2025 23:00:20 -0600 Subject: [PATCH 05/29] Update ruamel.yaml from pin to bounds (#520) This achieves two things. First, it gets us onto the latest version (as of today), and second it resolves any complaint that the pin is too restrictive for users. --- CHANGELOG.rst | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8f3c96d5f..52a536de6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,8 @@ Unreleased - Update the ``gitlab`` and ``renovate`` hooks to use ``--regex-variant nonunicode``. Thanks :user:`quentin-ag` and :user:`Callek` for reporting! (:issue:`516`, :issue:`518`) +- Update the required ``ruamel.yaml`` version to a range, + ``>=0.18.10,<0.19.0``. 0.31.0 ------ diff --git a/pyproject.toml b/pyproject.toml index eb0ca06e0..8b88c768d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ classifiers = [ requires-python = ">=3.9" dependencies = [ 'tomli>=2.0;python_version<"3.11"', - "ruamel.yaml==0.18.7", + "ruamel.yaml>=0.18.10,<0.19.0", "jsonschema>=4.18.0,<5.0", "regress>=2024.11.1", "requests<3.0", From 21483557f29f35c7e67c8555d45f356f0e45b32d Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Wed, 29 Jan 2025 23:07:38 -0600 Subject: [PATCH 06/29] Bump version for release --- CHANGELOG.rst | 6 +++++- README.md | 2 +- docs/optional_parsers.rst | 4 ++-- docs/precommit_usage.rst | 44 +++++++++++++++++++-------------------- pyproject.toml | 2 +- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 52a536de6..484aa5f9b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,7 +10,11 @@ Unreleased .. vendor-insert-here -- Update vendored schemas (2025-01-26) +0.31.1 +------ + +- Update vendored schemas: buildkite, cloudbuild, compose-spec, mergify, + renovate (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`) diff --git a/README.md b/README.md index 73bb8c742..9390c4974 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ files. ```yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-github-workflows args: ["--verbose"] diff --git a/docs/optional_parsers.rst b/docs/optional_parsers.rst index be86e9ec6..b86e335d7 100644 --- a/docs/optional_parsers.rst +++ b/docs/optional_parsers.rst @@ -20,7 +20,7 @@ For example, .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-renovate additional_dependencies: ['pyjson5'] @@ -45,7 +45,7 @@ For example, .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-jsonschema name: 'Check GitHub Workflows' diff --git a/docs/precommit_usage.rst b/docs/precommit_usage.rst index de58f08fa..f57941211 100644 --- a/docs/precommit_usage.rst +++ b/docs/precommit_usage.rst @@ -17,7 +17,7 @@ You must specify a schema using pre-commit ``args`` configuration. :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-jsonschema files: ^data/.*\.json$ @@ -34,7 +34,7 @@ Validate JSON Schema files against their matching metaschema, as specified in th :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-metaschema files: ^schemas/.*\.json$ @@ -52,7 +52,7 @@ Validate Azure Pipelines config against the schema provided by Microsoft :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-azure-pipelines @@ -66,7 +66,7 @@ Validate Bamboo Specs against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-bamboo-spec @@ -80,7 +80,7 @@ Validate Bitbucket Pipelines against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-bitbucket-pipelines @@ -94,7 +94,7 @@ Validate Buildkite Pipelines against the schema provided by Buildkite :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-buildkite @@ -108,7 +108,7 @@ Validate CircleCI config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-circle-ci @@ -122,7 +122,7 @@ Validate Google Cloud Build config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-cloudbuild @@ -136,7 +136,7 @@ Validate Docker Compose files against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-compose-spec @@ -150,7 +150,7 @@ Validate Dependabot Config (v2) against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-dependabot @@ -164,7 +164,7 @@ Validate Drone-CI Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-drone-ci @@ -178,7 +178,7 @@ Validate GitHub Actions against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-github-actions @@ -192,7 +192,7 @@ Validate GitHub Workflows against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-github-workflows @@ -206,7 +206,7 @@ Validate GitLab CI config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-gitlab-ci @@ -220,7 +220,7 @@ Validate Mergify config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-mergify @@ -234,7 +234,7 @@ Validate ReadTheDocs config against the schema provided by ReadTheDocs :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-readthedocs @@ -248,7 +248,7 @@ Validate Renovate config against the schema provided by Renovate (does not suppo :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-renovate @@ -262,7 +262,7 @@ Validate Taskfile config against the schema provided by Task :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-taskfile @@ -276,7 +276,7 @@ Validate Travis Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-travis @@ -290,7 +290,7 @@ Validate Woodpecker Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-woodpecker-ci @@ -316,7 +316,7 @@ manually, you could do this: .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-jsonschema name: "Check GitHub Workflows" @@ -335,7 +335,7 @@ To check with the builtin schema that a GitHub workflow sets .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-jsonschema name: "Check GitHub Workflows set timeout-minutes" diff --git a/pyproject.toml b/pyproject.toml index 8b88c768d..2a56a7c8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "check-jsonschema" -version = "0.31.0" +version = "0.31.1" description = "A jsonschema CLI and pre-commit hook" authors = [ { name = "Stephen Rosen", email = "sirosen0@gmail.com" }, From e773e5c8121a2e5a0d4e272195fd259028365126 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 00:37:12 -0600 Subject: [PATCH 07/29] Bump click-type-test from 1.0.0 to 1.1.0 (#522) Bumps [click-type-test](https://github.com/sirosen/click-type-test) from 1.0.0 to 1.1.0. - [Release notes](https://github.com/sirosen/click-type-test/releases) - [Changelog](https://github.com/sirosen/click-type-test/blob/main/CHANGELOG.md) - [Commits](https://github.com/sirosen/click-type-test/compare/1.0.0...1.1.0) --- updated-dependencies: - dependency-name: click-type-test dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2a56a7c8c..133114e49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ Homepage = "https://github.com/python-jsonschema/check-jsonschema" [project.optional-dependencies] dev = [ "pytest<9", - 'click-type-test==1.0.0;python_version>="3.10"', + 'click-type-test==1.1.0;python_version>="3.10"', "coverage<8", "pytest-xdist<4", "responses==0.25.3", From e6f3ca4068912cf89b3ea50be8c5e6fcf63f4b95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 01:13:45 -0600 Subject: [PATCH 08/29] Bump responses from 0.25.3 to 0.25.6 (#523) Bumps [responses](https://github.com/getsentry/responses) from 0.25.3 to 0.25.6. - [Release notes](https://github.com/getsentry/responses/releases) - [Changelog](https://github.com/getsentry/responses/blob/master/CHANGES) - [Commits](https://github.com/getsentry/responses/compare/0.25.3...0.25.6) --- updated-dependencies: - dependency-name: responses dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 133114e49..f875615c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dev = [ 'click-type-test==1.1.0;python_version>="3.10"', "coverage<8", "pytest-xdist<4", - "responses==0.25.3", + "responses==0.25.6", ] docs = [ "sphinx<9", From 14150ec8dbd6ead741cd441cb5616288211b8aa6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:34:11 -0600 Subject: [PATCH 09/29] [pre-commit.ci] pre-commit autoupdate (#525) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.31.0 → 0.31.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.0...0.31.1) - [github.com/psf/black-pre-commit-mirror: 24.10.0 → 25.1.0](https://github.com/psf/black-pre-commit-mirror/compare/24.10.0...25.1.0) - [github.com/PyCQA/isort: 5.13.2 → 6.0.0](https://github.com/PyCQA/isort/compare/5.13.2...6.0.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4eede38f1..bb7843cc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # dogfood - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.0 + rev: 0.31.1 hooks: - id: check-dependabot - id: check-github-workflows @@ -24,7 +24,7 @@ repos: - id: check-merge-conflict - id: trailing-whitespace - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.10.0 + rev: 25.1.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 @@ -40,7 +40,7 @@ repos: hooks: - id: slyp - repo: https://github.com/PyCQA/isort - rev: 5.13.2 + rev: 6.0.0 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade From f41a2c6811052292da0ce202897339d66cefbe90 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 14:26:58 -0600 Subject: [PATCH 10/29] [pre-commit.ci] pre-commit autoupdate (#527) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 7.1.1 → 7.1.2](https://github.com/PyCQA/flake8/compare/7.1.1...7.1.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .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 bb7843cc2..2cb7de293 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: hooks: - id: black - repo: https://github.com/PyCQA/flake8 - rev: 7.1.1 + rev: 7.1.2 hooks: - id: flake8 additional_dependencies: From 534c90d6b2d2fd7d99cd6fc34688cf3e05ac2cff Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:57:11 -0600 Subject: [PATCH 11/29] [vendor-schemas] automated update (#524) Co-authored-by: sirosen <1300022+sirosen@users.noreply.github.com> --- CHANGELOG.rst | 2 + .../builtin_schemas/vendor/gitlab-ci.json | 28 ++++++----- .../builtin_schemas/vendor/renovate.json | 49 ++++++++++++++++--- .../vendor/sha256/gitlab-ci.sha256 | 2 +- .../vendor/sha256/renovate.sha256 | 2 +- .../vendor/sha256/woodpecker-ci.sha256 | 2 +- .../builtin_schemas/vendor/woodpecker-ci.json | 20 +++++--- 7 files changed, 78 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 484aa5f9b..50c3bd9ac 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,8 @@ Unreleased .. vendor-insert-here +- Update vendored schemas (2025-02-16) + 0.31.1 ------ diff --git a/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json b/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json index 15b27b319..4d7dc7f26 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json +++ b/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://gitlab.com/.gitlab-ci.yml", - "markdownDescription": "Gitlab has a built-in solution for doing CI called Gitlab CI. It is configured by supplying a file called `.gitlab-ci.yml`, which will list all the jobs that are going to run for the project. A full list of all options can be found [here](https://docs.gitlab.com/ee/ci/yaml). [Learn More](https://docs.gitlab.com/ee/ci/index.html).", + "markdownDescription": "Gitlab has a built-in solution for doing CI called Gitlab CI. It is configured by supplying a file called `.gitlab-ci.yml`, which will list all the jobs that are going to run for the project. A full list of all options can be found [here](https://docs.gitlab.com/ee/ci/yaml/). [Learn More](https://docs.gitlab.com/ee/ci/).", "type": "object", "properties": { "$schema": { @@ -433,7 +433,7 @@ "additionalProperties": false, "properties": { "project": { - "description": "Path to the project, e.g. `group/project`, or `group/sub-group/project` [Learn more](https://docs.gitlab.com/ee/ci/yaml/index.html#includefile).", + "description": "Path to the project, e.g. `group/project`, or `group/sub-group/project` [Learn more](https://docs.gitlab.com/ee/ci/yaml/#includefile).", "type": "string", "pattern": "(?:\\S/\\S|\\$\\S+)" }, @@ -638,7 +638,7 @@ }, "entrypoint": { "type": "array", - "markdownDescription": "Command or script that should be executed as the container's entrypoint. It will be translated to Docker's --entrypoint option while creating the container. The syntax is similar to Dockerfile's ENTRYPOINT directive, where each shell token is a separate string in the array. [Learn More](https://docs.gitlab.com/ee/ci/services/index.html#available-settings-for-services)", + "markdownDescription": "Command or script that should be executed as the container's entrypoint. It will be translated to Docker's --entrypoint option while creating the container. The syntax is similar to Dockerfile's ENTRYPOINT directive, where each shell token is a separate string in the array. [Learn More](https://docs.gitlab.com/ee/ci/services/#available-settings-for-services)", "minItems": 1, "items": { "type": "string" @@ -691,7 +691,7 @@ }, "command": { "type": "array", - "markdownDescription": "Command or script that should be used as the container's command. It will be translated to arguments passed to Docker after the image's name. The syntax is similar to Dockerfile's CMD directive, where each shell token is a separate string in the array. [Learn More](https://docs.gitlab.com/ee/ci/services/index.html#available-settings-for-services)", + "markdownDescription": "Command or script that should be used as the container's command. It will be translated to arguments passed to Docker after the image's name. The syntax is similar to Dockerfile's CMD directive, where each shell token is a separate string in the array. [Learn More](https://docs.gitlab.com/ee/ci/services/#available-settings-for-services)", "minItems": 1, "items": { "type": "string" @@ -699,12 +699,12 @@ }, "alias": { "type": "string", - "markdownDescription": "Additional alias that can be used to access the service from the job's container. Read Accessing the services for more information. [Learn More](https://docs.gitlab.com/ee/ci/services/index.html#available-settings-for-services)", + "markdownDescription": "Additional alias that can be used to access the service from the job's container. Read Accessing the services for more information. [Learn More](https://docs.gitlab.com/ee/ci/services/#available-settings-for-services)", "minLength": 1 }, "variables": { "$ref": "#/definitions/jobVariables", - "markdownDescription": "Additional environment variables that are passed exclusively to the service. Service variables cannot reference themselves. [Learn More](https://docs.gitlab.com/ee/ci/services/index.html#available-settings-for-services)" + "markdownDescription": "Additional environment variables that are passed exclusively to the service. Service variables cannot reference themselves. [Learn More](https://docs.gitlab.com/ee/ci/services/#available-settings-for-services)" } }, "required": [ @@ -1174,7 +1174,7 @@ } }, "rulesVariables": { - "markdownDescription": "Defines variables for a rule result. [Learn More](https://docs.gitlab.com/ee/ci/yaml/index.html#rulesvariables).", + "markdownDescription": "Defines variables for a rule result. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#rulesvariables).", "type": "object", "patternProperties": { ".*": { @@ -1279,7 +1279,7 @@ }, "timeout": { "type": "string", - "markdownDescription": "Allows you to configure a timeout for a specific job (e.g. `1 minute`, `1h 30m 12s`). [Learn More](https://docs.gitlab.com/ee/ci/yaml/index.html#timeout).", + "markdownDescription": "Allows you to configure a timeout for a specific job (e.g. `1 minute`, `1h 30m 12s`). [Learn More](https://docs.gitlab.com/ee/ci/yaml/#timeout).", "minLength": 1 }, "start_in": { @@ -1288,7 +1288,7 @@ "minLength": 1 }, "rulesNeeds": { - "markdownDescription": "Use needs in rules to update job needs for specific conditions. When a condition matches a rule, the job's needs configuration is completely replaced with the needs in the rule. [Learn More](https://docs.gitlab.com/ee/ci/yaml/index.html#rulesneeds).", + "markdownDescription": "Use needs in rules to update job needs for specific conditions. When a condition matches a rule, the job's needs configuration is completely replaced with the needs in the rule. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#rulesneeds).", "type": "array", "items": { "oneOf": [ @@ -2152,7 +2152,7 @@ "description": "Limit job concurrency. Can be used to ensure that the Runner will not run certain jobs simultaneously." }, "trigger": { - "markdownDescription": "Trigger allows you to define downstream pipeline trigger. When a job created from trigger definition is started by GitLab, a downstream pipeline gets created. [Learn More](https://docs.gitlab.com/ee/ci/yaml/index.html#trigger).", + "markdownDescription": "Trigger allows you to define downstream pipeline trigger. When a job created from trigger definition is started by GitLab, a downstream pipeline gets created. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#trigger).", "oneOf": [ { "type": "object", @@ -2376,7 +2376,7 @@ } }, { - "markdownDescription": "Path to the project, e.g. `group/project`, or `group/sub-group/project`. [Learn More](https://docs.gitlab.com/ee/ci/yaml/index.html#trigger).", + "markdownDescription": "Path to the project, e.g. `group/project`, or `group/sub-group/project`. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#trigger).", "type": "string", "pattern": "(?:\\S/\\S|\\$\\S+)" } @@ -2430,7 +2430,7 @@ "additionalProperties": false }, "publish": { - "description": "A path to a directory that contains the files to be published with Pages", + "description": "Deprecated. Use `pages.publish` instead. A path to a directory that contains the files to be published with Pages.", "type": "string" }, "pages": { @@ -2446,6 +2446,10 @@ "expire_in": { "type": "string", "markdownDescription": "How long the deployment should be active. Deployments that have expired are no longer available on the web. Supports a wide variety of formats, e.g. '1 week', '3 mins 4 sec', '2 hrs 20 min', '2h20min', '6 mos 1 day', '47 yrs 6 mos and 4d', '3 weeks and 2 days'. Set to 'never' to prevent extra deployments from expiring. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#pagesexpire_in)." + }, + "publish": { + "type": "string", + "markdownDescription": "A path to a directory that contains the files to be published with Pages." } } }, diff --git a/src/check_jsonschema/builtin_schemas/vendor/renovate.json b/src/check_jsonschema/builtin_schemas/vendor/renovate.json index a9f02f44c..02a250639 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/renovate.json +++ b/src/check_jsonschema/builtin_schemas/vendor/renovate.json @@ -860,6 +860,7 @@ "description": "Custom manager to use. Valid only within a `customManagers` object.", "type": "string", "enum": [ + "jsonata", "regex" ] }, @@ -879,12 +880,19 @@ "description": "Optional `extractVersion` for extracted dependencies. Valid only within a `customManagers` object.", "type": "string" }, + "fileFormat": { + "description": "It specifies the syntax of the package file being managed by the custom JSONata manager.", + "type": "string", + "enum": [ + "json", + "yaml" + ] + }, "matchStrings": { - "description": "Regex capture rule to use. Valid only within a `customManagers` object.", + "description": "Queries to use. Valid only within a `customManagers` object.", "type": "array", "items": { - "type": "string", - "format": "regex" + "type": "string" } }, "matchStringsStrategy": { @@ -1024,6 +1032,16 @@ "type": "boolean", "default": false }, + "devbox": { + "description": "Configuration object for the devbox manager", + "type": "object", + "default": { + "fileMatch": [ + "(^|/)devbox\\.json$" + ] + }, + "$ref": "#" + }, "devcontainer": { "description": "Configuration object for the devcontainer manager", "type": "object", @@ -1072,7 +1090,7 @@ "dockerSidecarImage": { "description": "Change this value to override the default Renovate sidecar image.", "type": "string", - "default": "ghcr.io/containerbase/sidecar:13.7.1" + "default": "ghcr.io/containerbase/sidecar:13.7.2" }, "dockerUser": { "description": "Set the `UID` and `GID` for Docker-based binaries if you use `binarySource=docker`.", @@ -1908,6 +1926,14 @@ }, "$ref": "#" }, + "jsonata": { + "description": "Configuration object for the jsonata manager", + "type": "object", + "default": { + "pinDigests": false + }, + "$ref": "#" + }, "jsonnet-bundler": { "description": "Configuration object for the jsonnet-bundler manager", "type": "object", @@ -2191,7 +2217,7 @@ "fileMatch": [ "(^|/)flake\\.nix$" ], - "commitMessageTopic": "nixpkgs", + "commitMessageTopic": "nix", "commitMessageExtra": "to {{newValue}}", "enabled": false }, @@ -2213,7 +2239,8 @@ "type": "object", "default": { "fileMatch": [ - "(^|/)package\\.json$" + "(^|/)package\\.json$", + "(^|/)pnpm-workspace\\.yaml$" ], "digest": { "prBodyDefinitions": { @@ -3165,6 +3192,15 @@ }, "$ref": "#" }, + "replacementApproach": { + "description": "Select whether to perform a direct replacement or alias replacement.", + "type": "string", + "enum": [ + "replace", + "alias" + ], + "default": "replace" + }, "reportPath": { "description": "Path to where the file should be written. In case of `s3` this has to be a full S3 URI.", "type": [ @@ -3635,6 +3671,7 @@ "oneOf": [ { "enum": [ + "aws-eks-addon", "aws-machine-image", "azure-rest-api", "bazel-module", diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 index b226c3b98..0697b7616 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 @@ -1 +1 @@ -da5b6762e83b0d89dd145d0f9b8a25ef068b790577304df65d2d2bd5a4e0b21f \ No newline at end of file +f48b339b4ea94722060efb40d884ce2089a48b6732ef666538958d08102f45a2 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 index 276cb6555..ea770b404 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 @@ -1 +1 @@ -86655aecc05722842a57425aee1c82c6cfb120fe919940298355e72163c76e8e \ No newline at end of file +b927d2478e21f6bc423771ad88943933c9b6af2421dc29de4b247c93f0ec9555 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/woodpecker-ci.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/woodpecker-ci.sha256 index 887419bad..236d69bfa 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/woodpecker-ci.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/woodpecker-ci.sha256 @@ -1 +1 @@ -07850196eb7ee8c4f01f328d1a4345d2a4981b0086b33d1fd014dfeb3cc4316e \ No newline at end of file +cbdc42a5f4ff756568f95391688075622327e790cdcb669719cec3e192923878 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/woodpecker-ci.json b/src/check_jsonschema/builtin_schemas/vendor/woodpecker-ci.json index 6fcb37630..8cde9d42c 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/woodpecker-ci.json +++ b/src/check_jsonschema/builtin_schemas/vendor/woodpecker-ci.json @@ -762,15 +762,23 @@ "description": "A target which a native Kubernetes secret maps to.", "oneOf": [ { - "env": { - "description": "The name of the environment variable which secret maps to.", - "type": "string" + "type": "object", + "additionalProperties": false, + "properties": { + "env": { + "description": "The name of the environment variable which secret maps to.", + "type": "string" + } } }, { - "file": { - "description": "The filename (path) which secret maps to.", - "type": "string" + "type": "object", + "additionalProperties": false, + "properties": { + "file": { + "description": "The filename (path) which secret maps to.", + "type": "string" + } } } ] From 9decd7fb9769c309c171203db2fc69acfa103878 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Wed, 19 Feb 2025 21:21:42 -0600 Subject: [PATCH 12/29] Update the vendor-schemas script to list names The changelog modification step now - pulls the names of updated schemas from the changelog - adds any new updated schemas - sorts - textwraps - replaces any existing changelog item for schema updates And run the script, getting the latest updates and updating wtih schema names since the last release. --- CHANGELOG.rst | 3 +- RELEASING.md | 2 - scripts/vendor-schemas.py | 32 +++++-- .../builtin_schemas/vendor/dependabot.json | 1 + .../vendor/github-workflows.json | 1 + .../builtin_schemas/vendor/gitlab-ci.json | 5 ++ .../builtin_schemas/vendor/mergify.json | 85 ------------------- .../vendor/sha256/dependabot.sha256 | 2 +- .../vendor/sha256/github-workflows.sha256 | 2 +- .../vendor/sha256/gitlab-ci.sha256 | 2 +- .../vendor/sha256/mergify.sha256 | 2 +- 11 files changed, 39 insertions(+), 98 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 50c3bd9ac..4c1df3cc3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,7 +10,8 @@ Unreleased .. vendor-insert-here -- Update vendored schemas (2025-02-16) +- Update vendored schemas: dependabot, github-workflows, gitlab-ci, mergify, renovate, + woodpecker-ci (2025-02-19) 0.31.1 ------ diff --git a/RELEASING.md b/RELEASING.md index c473f645b..e03c89fab 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,8 +1,6 @@ # Releasing - Bump the version with `./scripts/bump-version.py NEW_VERSION` -- In the changelog, if there were vendored schema updates, note their - names (see past changelog entries for examples) - Add, commit with `git commit -m 'Bump version for release'`, and push - Create a release tag, which will auto-publish to testpypi (`make release`) - Create a GitHub release, which will auto-publish to pypi (web UI) diff --git a/scripts/vendor-schemas.py b/scripts/vendor-schemas.py index e7948be43..4d81ddd37 100644 --- a/scripts/vendor-schemas.py +++ b/scripts/vendor-schemas.py @@ -6,6 +6,7 @@ import os import re import subprocess +import textwrap import requests @@ -17,8 +18,9 @@ EXISTING_CHANGELINE_PATTERN = re.compile( re.escape(VENDOR_SLUG) - + "\n?- Update vendored schemas" - + r" \(\d{4}-\d{2}-\d{2}\)" + + "\n?- Update vendored schemas: " + + r"([\w-]+(,\s+[\w-]+)*) " + + r"\(\d{4}-\d{2}-\d{2}\)" + "\n", flags=re.MULTILINE, ) @@ -121,12 +123,30 @@ def update_changelog() -> None: print("changes were made, updating changelog") with open("CHANGELOG.rst", encoding="utf-8") as fp: content = fp.read() - new_slug = VENDOR_SLUG + f"\n- Update vendored schemas ({TODAY})\n" - if EXISTING_CHANGELINE_PATTERN.search(content): - content = EXISTING_CHANGELINE_PATTERN.sub(new_slug, content) + new_item_prefix = "- Update vendored schemas:" + + if match := EXISTING_CHANGELINE_PATTERN.search(content): + updated_schemas = {s.rstrip(",") for s in match.group(1).split()} + updated_schemas.update(SCHEMAS_WITH_NEW_HASHES) + else: + updated_schemas = SCHEMAS_WITH_NEW_HASHES + + schema_list = sorted(updated_schemas) + new_item = new_item_prefix + f" {', '.join(schema_list)} ({TODAY})\n" + + new_item = "\n".join( + textwrap.wrap( + new_item, break_on_hyphens=False, subsequent_indent=" ", width=88 + ) + ) + new_item = f"{VENDOR_SLUG}\n{new_item}\n" + + if match: + content = EXISTING_CHANGELINE_PATTERN.sub(new_item, content) else: - content = content.replace(VENDOR_SLUG, new_slug) + content = content.replace(VENDOR_SLUG, new_item) + with open("CHANGELOG.rst", "w", encoding="utf-8") as fp: fp.write(content) diff --git a/src/check_jsonschema/builtin_schemas/vendor/dependabot.json b/src/check_jsonschema/builtin_schemas/vendor/dependabot.json index c860ceac1..8a108d0e3 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/dependabot.json +++ b/src/check_jsonschema/builtin_schemas/vendor/dependabot.json @@ -647,6 +647,7 @@ }, "package-ecosystem-values": { "enum": [ + "bun", "bundler", "cargo", "composer", diff --git a/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json b/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json index 842f5d493..de4dcd891 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json +++ b/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json @@ -1640,6 +1640,7 @@ "description": "You can schedule a workflow to run at specific UTC times using POSIX cron syntax (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07). Scheduled workflows run on the latest commit on the default or base branch. The shortest interval you can run scheduled workflows is once every 5 minutes.\nNote: GitHub Actions does not support the non-standard syntax @yearly, @monthly, @weekly, @daily, @hourly, and @reboot.\nYou can use crontab guru (https://crontab.guru/). to help generate your cron syntax and confirm what time it will run. To help you get started, there is also a list of crontab guru examples (https://crontab.guru/examples.html).", "type": "array", "items": { + "type": "object", "properties": { "cron": { "type": "string" diff --git a/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json b/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json index 4d7dc7f26..481f52212 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json +++ b/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json @@ -521,6 +521,11 @@ "format": "uri-reference", "pattern": "^https?://.+\\.ya?ml$" }, + "integrity": { + "description": "SHA256 integrity hash of the remote file content.", + "type": "string", + "pattern": "^sha256-[A-Za-z0-9+/]{43}=$" + }, "rules": { "$ref": "#/definitions/includeRules" }, diff --git a/src/check_jsonschema/builtin_schemas/vendor/mergify.json b/src/check_jsonschema/builtin_schemas/vendor/mergify.json index b341bff6e..f3d423400 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/mergify.json +++ b/src/check_jsonschema/builtin_schemas/vendor/mergify.json @@ -1212,13 +1212,6 @@ "default": null, "description": "Template to use as the commit message when using the merge or squash merge method.", "title": "Commit Message Template" - }, - "allow_merging_configuration_change": { - "default": true, - "deprecated": true, - "description": "Allow merging the Mergify configuration file. *This option does not do anything and is only present for backward compatibility.*", - "title": "Allow Merging Configuration Change", - "type": "boolean" } }, "title": "MergeActionModel", @@ -1569,11 +1562,6 @@ "description": "The review decision. This indicates if `CODEOWNERS` have reviewed the pull request when the `Require Review from Code Owners` branch protection rule is enabled.", "title": "Branch protection review decision" }, - "queue-frozen": { - "description": "Whether the pull request is in a queue that is frozen.", - "title": "Queue frozen", - "type": "boolean" - }, "number": { "description": "The pull request number.", "minimum": 0, @@ -1724,18 +1712,6 @@ "description": "The name of the queue containing the pull request.", "title": "Queue name" }, - "queue-freeze-reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The reason for the queue containing the pull request to be frozen.", - "title": "Queue freeze reason" - }, "queue-partition-name": { "anyOf": [ { @@ -2107,7 +2083,6 @@ "linear-history", "conflict", "branch-protection-review-decision", - "queue-frozen", "number", "queue-position", "author", @@ -2124,7 +2099,6 @@ "repository-full-name", "queue-dequeue-reason", "queue-name", - "queue-freeze-reason", "queue-partition-name", "assignee", "label", @@ -2401,13 +2375,6 @@ "description": "Allow merging the Mergify configuration file. *This option does not do anything and is only present for backward compatibility.*", "title": "Allow Merging Configuration Change", "type": "boolean" - }, - "autosquash": { - "default": true, - "deprecated": true, - "description": "This option is relevant only if you do in place checks and if you use the `rebase` option of the update_method. It will automatically squash your commits beginning by `squash!`, `fixup!` or `amend!`, just like the option with the same name when doing a `git rebase`.", - "title": "Autosquash", - "type": "boolean" } }, "title": "QueueActionModel", @@ -2437,15 +2404,6 @@ "QueueRuleModel": { "additionalProperties": false, "properties": { - "priority_rules": { - "$ref": "#/$defs/PriorityRulesModel", - "configuration_deprecated_attribute": { - "deprecated_summary_ghes_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `priority_rules` attribute in the `queue_rules` section. The priority rules must now be set at the top level of the configuration file.**\n> This option will be removed in a future version.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules", - "deprecated_summary_saas_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `priority_rules` attribute in the `queue_rules` section. The priority rules must now be set at the top level of the configuration file.**\nThis option will be removed on January 31st, 2025\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules" - }, - "deprecated": true, - "description": "*This attribute is deprecated in favor of `priority_rules` at the top level of the Mergify configuration file.* The list of priority rules a pull request can match in order to be prioritized when added to a queue. The rule with the highest priority value wins." - }, "queue_conditions": { "$ref": "#/$defs/QueueRuleMergeConditionsModel", "description": "The list of conditions that needs to match to queue the pull request." @@ -2664,23 +2622,6 @@ "title": "Disallow Checks Interruption From Queues", "type": "array" }, - "allow_checks_interruption": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "configuration_deprecated_attribute": { - "deprecated_summary_ghes_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `allow_checks_interruption` attribute in the `queue_rules` section. This option must now be set at the top level of the configuration file in the `priority_rules` section.**\n> This option will be removed in a future version.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules", - "deprecated_summary_saas_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `allow_checks_interruption` attribute in the `queue_rules` section. This option must now be set at the top level of the configuration file in the `priority_rules` section.**\n> This option will be removed on January 31st, 2025.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules" - }, - "default": null, - "deprecated": true, - "title": "Allow Checks Interruption" - }, "name": { "title": "Name", "type": "string" @@ -2695,15 +2636,6 @@ "QueueRuleModelForDefaults": { "additionalProperties": false, "properties": { - "priority_rules": { - "$ref": "#/$defs/PriorityRulesModel", - "configuration_deprecated_attribute": { - "deprecated_summary_ghes_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `priority_rules` attribute in the `queue_rules` section. The priority rules must now be set at the top level of the configuration file.**\n> This option will be removed in a future version.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules", - "deprecated_summary_saas_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `priority_rules` attribute in the `queue_rules` section. The priority rules must now be set at the top level of the configuration file.**\nThis option will be removed on January 31st, 2025\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules" - }, - "deprecated": true, - "description": "*This attribute is deprecated in favor of `priority_rules` at the top level of the Mergify configuration file.* The list of priority rules a pull request can match in order to be prioritized when added to a queue. The rule with the highest priority value wins." - }, "queue_conditions": { "$ref": "#/$defs/QueueRuleMergeConditionsModel", "description": "The list of conditions that needs to match to queue the pull request." @@ -2921,23 +2853,6 @@ "maxItems": 50, "title": "Disallow Checks Interruption From Queues", "type": "array" - }, - "allow_checks_interruption": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "configuration_deprecated_attribute": { - "deprecated_summary_ghes_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `allow_checks_interruption` attribute in the `queue_rules` section. This option must now be set at the top level of the configuration file in the `priority_rules` section.**\n> This option will be removed in a future version.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules", - "deprecated_summary_saas_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `allow_checks_interruption` attribute in the `queue_rules` section. This option must now be set at the top level of the configuration file in the `priority_rules` section.**\n> This option will be removed on January 31st, 2025.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules" - }, - "default": null, - "deprecated": true, - "title": "Allow Checks Interruption" } }, "title": "QueueRuleModelForDefaults", diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/dependabot.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/dependabot.sha256 index d75fcffb8..647cb5503 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/dependabot.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/dependabot.sha256 @@ -1 +1 @@ -bb1d6e2ddccbdc94a4ea84617fa89af57f6938b9ef72095583a31b6914c8ae1c \ No newline at end of file +c3463cad77fbd8f9e520c140b8bd337ff6c52190b9079e4661f4cf548ebf44b4 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 index 0b6155d29..9ffe1c1eb 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 @@ -1 +1 @@ -72980780f308c86943ff694531ca6f7cdc56afcddefd85d4cd11632f9c3f87ef \ No newline at end of file +a4e9db7fb53cb6dd91b3c71449b98f42d8e778ebf6cf1bd1b8c3224f3dce8bee \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 index 0697b7616..37f872873 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 @@ -1 +1 @@ -f48b339b4ea94722060efb40d884ce2089a48b6732ef666538958d08102f45a2 \ No newline at end of file +7570c1d2b90e172fdcc05906939e70aeb34c12e5c9ebc24f10600c68641762a5 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 index 3cadce6db..e30957b15 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 @@ -1 +1 @@ -898c7fc37bca50fd7b79b4181e59a4485051c3cd30412200bdfdd7351848f963 \ No newline at end of file +a5a886702e1102c86a72bcc676f5da57d697718a91f7ab529a9ac17def47c6b7 \ No newline at end of file From 6a01bef7bf8c33841ae95cf934d3f3cda607b7dd Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Wed, 19 Feb 2025 21:26:43 -0600 Subject: [PATCH 13/29] Bump version for release --- CHANGELOG.rst | 3 +++ README.md | 2 +- docs/optional_parsers.rst | 4 ++-- docs/precommit_usage.rst | 44 +++++++++++++++++++-------------------- pyproject.toml | 2 +- 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4c1df3cc3..04cc5629f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,9 @@ Unreleased .. vendor-insert-here +0.31.2 +------ + - Update vendored schemas: dependabot, github-workflows, gitlab-ci, mergify, renovate, woodpecker-ci (2025-02-19) diff --git a/README.md b/README.md index 9390c4974..ecc10916d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ files. ```yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-github-workflows args: ["--verbose"] diff --git a/docs/optional_parsers.rst b/docs/optional_parsers.rst index b86e335d7..d0e89f1bc 100644 --- a/docs/optional_parsers.rst +++ b/docs/optional_parsers.rst @@ -20,7 +20,7 @@ For example, .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-renovate additional_dependencies: ['pyjson5'] @@ -45,7 +45,7 @@ For example, .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-jsonschema name: 'Check GitHub Workflows' diff --git a/docs/precommit_usage.rst b/docs/precommit_usage.rst index f57941211..aa595af7b 100644 --- a/docs/precommit_usage.rst +++ b/docs/precommit_usage.rst @@ -17,7 +17,7 @@ You must specify a schema using pre-commit ``args`` configuration. :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-jsonschema files: ^data/.*\.json$ @@ -34,7 +34,7 @@ Validate JSON Schema files against their matching metaschema, as specified in th :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-metaschema files: ^schemas/.*\.json$ @@ -52,7 +52,7 @@ Validate Azure Pipelines config against the schema provided by Microsoft :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-azure-pipelines @@ -66,7 +66,7 @@ Validate Bamboo Specs against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-bamboo-spec @@ -80,7 +80,7 @@ Validate Bitbucket Pipelines against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-bitbucket-pipelines @@ -94,7 +94,7 @@ Validate Buildkite Pipelines against the schema provided by Buildkite :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-buildkite @@ -108,7 +108,7 @@ Validate CircleCI config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-circle-ci @@ -122,7 +122,7 @@ Validate Google Cloud Build config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-cloudbuild @@ -136,7 +136,7 @@ Validate Docker Compose files against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-compose-spec @@ -150,7 +150,7 @@ Validate Dependabot Config (v2) against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-dependabot @@ -164,7 +164,7 @@ Validate Drone-CI Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-drone-ci @@ -178,7 +178,7 @@ Validate GitHub Actions against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-github-actions @@ -192,7 +192,7 @@ Validate GitHub Workflows against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-github-workflows @@ -206,7 +206,7 @@ Validate GitLab CI config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-gitlab-ci @@ -220,7 +220,7 @@ Validate Mergify config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-mergify @@ -234,7 +234,7 @@ Validate ReadTheDocs config against the schema provided by ReadTheDocs :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-readthedocs @@ -248,7 +248,7 @@ Validate Renovate config against the schema provided by Renovate (does not suppo :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-renovate @@ -262,7 +262,7 @@ Validate Taskfile config against the schema provided by Task :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-taskfile @@ -276,7 +276,7 @@ Validate Travis Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-travis @@ -290,7 +290,7 @@ Validate Woodpecker Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-woodpecker-ci @@ -316,7 +316,7 @@ manually, you could do this: .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-jsonschema name: "Check GitHub Workflows" @@ -335,7 +335,7 @@ To check with the builtin schema that a GitHub workflow sets .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-jsonschema name: "Check GitHub Workflows set timeout-minutes" diff --git a/pyproject.toml b/pyproject.toml index f875615c4..54349b0da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "check-jsonschema" -version = "0.31.1" +version = "0.31.2" description = "A jsonschema CLI and pre-commit hook" authors = [ { name = "Stephen Rosen", email = "sirosen0@gmail.com" }, From 9d58794536a36070612042445197547b3428b4ed Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 23 Feb 2025 10:11:50 -0600 Subject: [PATCH 14/29] [vendor-schemas] automated update (#529) Co-authored-by: sirosen <1300022+sirosen@users.noreply.github.com> --- CHANGELOG.rst | 2 ++ .../builtin_schemas/vendor/renovate.json | 9 ++++++ .../vendor/sha256/renovate.sha256 | 2 +- .../vendor/sha256/taskfile.sha256 | 2 +- .../builtin_schemas/vendor/taskfile.json | 31 ++++++++++++++++--- 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 04cc5629f..dba7278e0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,8 @@ Unreleased .. vendor-insert-here +- Update vendored schemas: renovate, taskfile (2025-02-23) + 0.31.2 ------ diff --git a/src/check_jsonschema/builtin_schemas/vendor/renovate.json b/src/check_jsonschema/builtin_schemas/vendor/renovate.json index 02a250639..f226ef77e 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/renovate.json +++ b/src/check_jsonschema/builtin_schemas/vendor/renovate.json @@ -3045,6 +3045,15 @@ "description": "Path to the Server-side old private key.", "type": "string" }, + "processEnv": { + "description": "Environment variables to be used in global config only.", + "type": "object", + "default": {}, + "additionalProperties": { + "type": "string" + }, + "$ref": "#" + }, "productLinks": { "description": "Links which are used in PRs, issues and comments.", "type": "object", diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 index ea770b404..f278f9f25 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 @@ -1 +1 @@ -b927d2478e21f6bc423771ad88943933c9b6af2421dc29de4b247c93f0ec9555 \ No newline at end of file +62f681572cbb7f62690f245583e1ef6dab7d86e49767744c68748b9bdf5fa57a \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/taskfile.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/taskfile.sha256 index ba28a1442..31e0bca03 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/taskfile.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/taskfile.sha256 @@ -1 +1 @@ -e991e9f53f0615caf16c0777d9f38e5aa8243407283205110f3514d1375097ff \ No newline at end of file +4ed69fa81667b77ee5e0146080dd73b376ee88ea5dd23e743644a495c7f35c80 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/taskfile.json b/src/check_jsonschema/builtin_schemas/vendor/taskfile.json index da25a209f..a44df7a8d 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/taskfile.json +++ b/src/check_jsonschema/builtin_schemas/vendor/taskfile.json @@ -29,6 +29,12 @@ }, { "$ref": "#/definitions/task_call" + }, + { + "$ref": "#/definitions/defer_task_call" + }, + { + "$ref": "#/definitions/defer_cmd_call" } ] } @@ -216,7 +222,10 @@ "$ref": "#/definitions/task_call" }, { - "$ref": "#/definitions/defer_call" + "$ref": "#/definitions/defer_task_call" + }, + { + "$ref": "#/definitions/defer_cmd_call" }, { "$ref": "#/definitions/for_cmds_call" @@ -350,15 +359,12 @@ "additionalProperties": false, "required": ["cmd"] }, - "defer_call": { + "defer_task_call": { "type": "object", "properties": { "defer": { "description": "Run a command when the task completes. This command will run even when the task fails", "anyOf": [ - { - "type": "string" - }, { "$ref": "#/definitions/task_call" } @@ -368,6 +374,21 @@ "additionalProperties": false, "required": ["defer"] }, + "defer_cmd_call": { + "type": "object", + "properties": { + "defer": { + "description": "Name of the command to defer", + "type": "string" + }, + "silent": { + "description": "Hides task name and command from output. The command's output will still be redirected to `STDOUT` and `STDERR`.", + "type": "boolean" + } + }, + "additionalProperties": false, + "required": ["defer"] + }, "for_cmds_call": { "type": "object", "properties": { From f4dd2d2244508de4a6a02ab870ef147383cba470 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 13:31:30 -0600 Subject: [PATCH 15/29] [pre-commit.ci] pre-commit autoupdate (#530) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.31.1 → 0.31.2](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.1...0.31.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .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 2cb7de293..4156d7cbe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # dogfood - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.1 + rev: 0.31.2 hooks: - id: check-dependabot - id: check-github-workflows From e541734cca9957176f47913650b3d27bb1c94146 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Sat, 1 Mar 2025 22:31:40 -0500 Subject: [PATCH 16/29] Update vendored schemas (#532) And update RTD schema to use 'main'. The main branch for the RTD repo was renamed from 'master'. --- CHANGELOG.rst | 3 +- .../builtin_schemas/vendor/circle-ci.json | 9 +- .../vendor/github-workflows.json | 255 +++++++++--------- .../builtin_schemas/vendor/mergify.json | 30 +++ .../vendor/sha256/circle-ci.sha256 | 2 +- .../vendor/sha256/github-workflows.sha256 | 2 +- .../vendor/sha256/mergify.sha256 | 2 +- src/check_jsonschema/catalog.py | 2 +- 8 files changed, 170 insertions(+), 135 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index dba7278e0..d3ffb2fc3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,7 +10,8 @@ Unreleased .. vendor-insert-here -- Update vendored schemas: renovate, taskfile (2025-02-23) +- Update vendored schemas: circle-ci, github-workflows, mergify, renovate, taskfile + (2025-02-28) 0.31.2 ------ diff --git a/src/check_jsonschema/builtin_schemas/vendor/circle-ci.json b/src/check_jsonschema/builtin_schemas/vendor/circle-ci.json index 2f54c3f0d..01e68da80 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/circle-ci.json +++ b/src/check_jsonschema/builtin_schemas/vendor/circle-ci.json @@ -1321,6 +1321,8 @@ "ubuntu-2404:2024.05.1", "ubuntu-2404:current", "ubuntu-2404:edge", + "android:2024.11.1", + "android:2024.07.1", "android:2024.04.1", "android:2024.01.1", "android:2023.11.1", @@ -1425,7 +1427,12 @@ "macOSResourceClass": { "description": "Amount of CPU and RAM allocated for each job. View [available resource classes](https://circleci.com/docs/configuration-reference/#macos-execution-environment).", "type": "string", - "enum": ["macos.m1.medium.gen1", "macos.m1.large.gen1"] + "enum": [ + "macos.m1.medium.gen1", + "macos.m1.large.gen1", + "m2pro.medium", + "m2pro.large" + ] }, "xcodeVersion": { "description": "The version of Xcode to use. View [available versions](https://circleci.com/developer/machine/image/xcode)", diff --git a/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json b/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json index de4dcd891..d1dbfe1fe 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json +++ b/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json @@ -843,6 +843,131 @@ }, "required": ["runs-on"], "additionalProperties": false + }, + "workflowDispatchInput": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_id", + "description": "A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", + "type": "object", + "properties": { + "description": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", + "description": "A string description of the input parameter.", + "type": "string" + }, + "deprecationMessage": { + "description": "A string shown to users using the deprecated input.", + "type": "string" + }, + "required": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", + "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.", + "type": "boolean" + }, + "default": { + "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", + "description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file." + }, + "type": { + "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputsinput_idtype", + "description": "A string representing the type of the input.", + "type": "string", + "enum": ["string", "choice", "boolean", "number", "environment"] + }, + "options": { + "$comment": "https://github.blog/changelog/2021-11-10-github-actions-input-types-for-manual-workflows", + "description": "The options of the dropdown list, if the type is a choice.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "string" + } + }, + "required": ["type"] + }, + "then": { + "properties": { + "default": { + "type": "string" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "boolean" + } + }, + "required": ["type"] + }, + "then": { + "properties": { + "default": { + "type": "boolean" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "number" + } + }, + "required": ["type"] + }, + "then": { + "properties": { + "default": { + "type": "number" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "environment" + } + }, + "required": ["type"] + }, + "then": { + "properties": { + "default": { + "type": "string" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "choice" + } + }, + "required": ["type"] + }, + "then": { + "required": ["options"] + } + } + ], + "required": ["description"], + "additionalProperties": false } }, "properties": { @@ -1469,135 +1594,7 @@ "type": "object", "patternProperties": { "^[_a-zA-Z][a-zA-Z0-9_-]*$": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_id", - "description": "A string identifier to associate with the input. The value of is a map of the input's metadata. The must be a unique identifier within the inputs object. The must start with a letter or _ and contain only alphanumeric characters, -, or _.", - "type": "object", - "properties": { - "description": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddescription", - "description": "A string description of the input parameter.", - "type": "string" - }, - "deprecationMessage": { - "description": "A string shown to users using the deprecated input.", - "type": "string" - }, - "required": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", - "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.", - "type": "boolean" - }, - "default": { - "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_iddefault", - "description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file." - }, - "type": { - "$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputsinput_idtype", - "description": "A string representing the type of the input.", - "type": "string", - "enum": [ - "string", - "choice", - "boolean", - "number", - "environment" - ] - }, - "options": { - "$comment": "https://github.blog/changelog/2021-11-10-github-actions-input-types-for-manual-workflows", - "description": "The options of the dropdown list, if the type is a choice.", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - } - }, - "allOf": [ - { - "if": { - "properties": { - "type": { - "const": "string" - } - }, - "required": ["type"] - }, - "then": { - "properties": { - "default": { - "type": "string" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "const": "boolean" - } - }, - "required": ["type"] - }, - "then": { - "properties": { - "default": { - "type": "boolean" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "const": "number" - } - }, - "required": ["type"] - }, - "then": { - "properties": { - "default": { - "type": "number" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "const": "environment" - } - }, - "required": ["type"] - }, - "then": { - "properties": { - "default": { - "type": "string" - } - } - } - }, - { - "if": { - "properties": { - "type": { - "const": "choice" - } - }, - "required": ["type"] - }, - "then": { - "required": ["options"] - } - } - ], - "required": ["description"], - "additionalProperties": false + "$ref": "#/definitions/workflowDispatchInput" } }, "additionalProperties": false diff --git a/src/check_jsonschema/builtin_schemas/vendor/mergify.json b/src/check_jsonschema/builtin_schemas/vendor/mergify.json index f3d423400..26d8290db 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/mergify.json +++ b/src/check_jsonschema/builtin_schemas/vendor/mergify.json @@ -1284,6 +1284,23 @@ "title": "MergeProtectionRulesModel", "type": "array" }, + "MergeProtectionsModel": { + "additionalProperties": false, + "properties": { + "reporting_method": { + "default": "check-runs", + "description": "The merge protection reporting method", + "enum": [ + "check-runs", + "deployments" + ], + "title": "Reporting Method", + "type": "string" + } + }, + "title": "MergeProtectionsModel", + "type": "object" + }, "MergeQueueModel": { "additionalProperties": false, "properties": { @@ -2615,6 +2632,11 @@ "title": "Update Bot Account" }, "disallow_checks_interruption_from_queues": { + "configuration_deprecated_attribute": { + "deprecated_summary_ghes_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `disallow_checks_interruption_from_queues` attribute in the `queue_rules` section. It has been replaced in favor of using `priority_rules` at the top-level of the configuration.\n> For more information: https://docs.mergify.com/merge-queue/priority/", + "deprecated_summary_saas_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `disallow_checks_interruption_from_queues` attribute in the `queue_rules` section. It has been replaced in favor of using `priority_rules` at the top-level of the configuration.\n> For more information: https://docs.mergify.com/merge-queue/priority/" + }, + "deprecated": true, "items": { "type": "string" }, @@ -2847,6 +2869,11 @@ "title": "Update Bot Account" }, "disallow_checks_interruption_from_queues": { + "configuration_deprecated_attribute": { + "deprecated_summary_ghes_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `disallow_checks_interruption_from_queues` attribute in the `queue_rules` section. It has been replaced in favor of using `priority_rules` at the top-level of the configuration.\n> For more information: https://docs.mergify.com/merge-queue/priority/", + "deprecated_summary_saas_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `disallow_checks_interruption_from_queues` attribute in the `queue_rules` section. It has been replaced in favor of using `priority_rules` at the top-level of the configuration.\n> For more information: https://docs.mergify.com/merge-queue/priority/" + }, + "deprecated": true, "items": { "type": "string" }, @@ -3163,6 +3190,9 @@ }, "merge_queue": { "$ref": "#/$defs/MergeQueueModel" + }, + "merge_protections_settings": { + "$ref": "#/$defs/MergeProtectionsModel" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/circle-ci.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/circle-ci.sha256 index 557aa8af6..32be41c77 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/circle-ci.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/circle-ci.sha256 @@ -1 +1 @@ -cd652ef789d666c07f2fd5e6236ae2a491e11506addb42466f6c9911fa997955 \ No newline at end of file +07533ac8ed37edd4ee71bc39daecd03c5ee88619732e7dc24cf7627a272d9cd1 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 index 9ffe1c1eb..ab9433a9c 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 @@ -1 +1 @@ -a4e9db7fb53cb6dd91b3c71449b98f42d8e778ebf6cf1bd1b8c3224f3dce8bee \ No newline at end of file +287c4e34b14a32340166605a8b98846409f9177234d1f308263834a31b7692e7 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 index e30957b15..da1d9f828 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 @@ -1 +1 @@ -a5a886702e1102c86a72bcc676f5da57d697718a91f7ab529a9ac17def47c6b7 \ No newline at end of file +acebe3821816bbf8e9dafbd15146dfce5a12f9c49075e6132cb56b51f47a53ec \ No newline at end of file diff --git a/src/check_jsonschema/catalog.py b/src/check_jsonschema/catalog.py index 0bedd57a1..dcbcf3c58 100644 --- a/src/check_jsonschema/catalog.py +++ b/src/check_jsonschema/catalog.py @@ -182,7 +182,7 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: "url": _githubusercontent_url( "readthedocs", "readthedocs.org", - "master", + "main", "readthedocs/rtd_tests/fixtures/spec/v2/schema.json", ), "hook_config": { From d12381a34554ed21891daac76020aa558b0cee8f Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Sat, 1 Mar 2025 23:01:25 -0500 Subject: [PATCH 17/29] Minor CI and test config improvements (#533) * Fix tox coverage config Run coverage after py3.13 tests, and combine+report in separate steps to get simpler reporting semantics when using `tox p`. * Improve CI job names --- .github/workflows/build.yaml | 10 +++++----- tox.ini | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cf630c3e3..0f14f3c1e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,7 +14,7 @@ jobs: py: "3.9" runs-on: ubuntu-latest - name: "Run '${{ matrix.toxenv }}' on python ${{ matrix.py }}" + name: "'${{ matrix.toxenv }}' on py${{ matrix.py }}" steps: - uses: actions/checkout@v4 @@ -61,10 +61,10 @@ jobs: ci-test-matrix: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu, windows, macos] py: ['3.9', '3.10', '3.11', '3.12', '3.13'] - name: "Run tests on ${{ matrix.os }}, py${{ matrix.py }}" - runs-on: ${{ matrix.os }} + name: "Test on ${{ matrix.os }}, py${{ matrix.py }}" + runs-on: "${{ matrix.os }}-latest" steps: - uses: actions/checkout@v4 @@ -98,7 +98,7 @@ jobs: - name: test run: | python -m tox run -m ci -- --junitxml pytest.{envname}.xml - python -m tox run -e cov + python -m tox run -e cov_combine,cov_report - uses: actions/upload-artifact@v4 with: diff --git a/tox.ini b/tox.ini index 6edec916f..115d46171 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,8 @@ envlist = py{313,312,311,310,39} py{39,313}-{json5,pyjson5}{,-format} py{39,313}-{disable_orjson} - cov + cov_combine + cov_report skip_missing_interpreters = true minversion = 4.0.0 @@ -39,13 +40,19 @@ skip_install = true commands = coverage erase depends = -[testenv:cov] -description = "combine and report coverage data" +[testenv:cov_combine] +description = "combine coverage data" +deps = coverage +skip_install = true +commands = coverage combine +depends = py{,38,39,310,311,312,313}{,-mindeps,-format,-json5,-pyjson5,-disable_orjson} + +[testenv:cov_report] +description = "report test coverage" deps = coverage skip_install = true -commands_pre = - coverage combine commands = coverage report --skip-covered -depends = py{,38,39,310,311,312}{,-mindeps,-format,-json5,-pyjson5,-disable_orjson} +depends = cov_combine [testenv:mypy] description = "check type annotations with mypy" From bfd58f04218e4b181b77661075527e52dc89bb28 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 09:18:14 -0600 Subject: [PATCH 18/29] [pre-commit.ci] pre-commit autoupdate (#534) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/sirosen/slyp: 0.8.1 → 0.8.2](https://github.com/sirosen/slyp/compare/0.8.1...0.8.2) - [github.com/PyCQA/isort: 6.0.0 → 6.0.1](https://github.com/PyCQA/isort/compare/6.0.0...6.0.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4156d7cbe..56bd27220 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,11 +36,11 @@ repos: - 'flake8-typing-as-t==0.0.3' - 'flake8-comprehensions==3.15.0' - repo: https://github.com/sirosen/slyp - rev: 0.8.1 + rev: 0.8.2 hooks: - id: slyp - repo: https://github.com/PyCQA/isort - rev: 6.0.0 + rev: 6.0.1 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade From e5c946c14cf21895690354453c40166f798f63aa Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Fri, 7 Mar 2025 11:30:51 -0600 Subject: [PATCH 19/29] Fix minor bug in vendor schemas script + run it to get the latest mergify + renovate schemas --- CHANGELOG.rst | 2 +- scripts/vendor-schemas.py | 2 +- src/check_jsonschema/builtin_schemas/vendor/mergify.json | 7 ++++--- src/check_jsonschema/builtin_schemas/vendor/renovate.json | 3 ++- .../builtin_schemas/vendor/sha256/mergify.sha256 | 2 +- .../builtin_schemas/vendor/sha256/renovate.sha256 | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d3ffb2fc3..deb78797d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,7 +11,7 @@ Unreleased .. vendor-insert-here - Update vendored schemas: circle-ci, github-workflows, mergify, renovate, taskfile - (2025-02-28) + (2025-03-07) 0.31.2 ------ diff --git a/scripts/vendor-schemas.py b/scripts/vendor-schemas.py index 4d81ddd37..36e5ea966 100644 --- a/scripts/vendor-schemas.py +++ b/scripts/vendor-schemas.py @@ -19,7 +19,7 @@ EXISTING_CHANGELINE_PATTERN = re.compile( re.escape(VENDOR_SLUG) + "\n?- Update vendored schemas: " - + r"([\w-]+(,\s+[\w-]+)*) " + + r"([\w-]+(,\s+[\w-]+)*)\s+" + r"\(\d{4}-\d{2}-\d{2}\)" + "\n", flags=re.MULTILINE, diff --git a/src/check_jsonschema/builtin_schemas/vendor/mergify.json b/src/check_jsonschema/builtin_schemas/vendor/mergify.json index 26d8290db..42f9a3337 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/mergify.json +++ b/src/check_jsonschema/builtin_schemas/vendor/mergify.json @@ -347,7 +347,7 @@ "default": [ "check" ], - "description": "List of reporting modes for the action's result.", + "description": "Reporting modes for the action's result. Check will create a check on the pull request, and comment will post a comment on the pull request.", "items": { "enum": [ "check", @@ -812,7 +812,7 @@ "default": [ "check" ], - "description": "List of reporting modes for the action's result.", + "description": "Reporting modes for the action's result. Check will create a check on the pull request, and comment will post a comment on the pull request.", "items": { "enum": [ "check", @@ -1706,7 +1706,8 @@ "PULL_REQUEST_UPDATED", "MERGE_QUEUE_RESET", "INCOMPATIBILITY_WITH_BRANCH_PROTECTIONS", - "PR_MANUALLY_MERGED" + "PR_MANUALLY_MERGED", + "DRAFT_PULL_REQUEST_CREATION_FAILED" ], "type": "string" }, diff --git a/src/check_jsonschema/builtin_schemas/vendor/renovate.json b/src/check_jsonschema/builtin_schemas/vendor/renovate.json index f226ef77e..01a73e5d7 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/renovate.json +++ b/src/check_jsonschema/builtin_schemas/vendor/renovate.json @@ -885,6 +885,7 @@ "type": "string", "enum": [ "json", + "toml", "yaml" ] }, @@ -1090,7 +1091,7 @@ "dockerSidecarImage": { "description": "Change this value to override the default Renovate sidecar image.", "type": "string", - "default": "ghcr.io/containerbase/sidecar:13.7.2" + "default": "ghcr.io/containerbase/sidecar:13.8.4" }, "dockerUser": { "description": "Set the `UID` and `GID` for Docker-based binaries if you use `binarySource=docker`.", diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 index da1d9f828..431745e84 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 @@ -1 +1 @@ -acebe3821816bbf8e9dafbd15146dfce5a12f9c49075e6132cb56b51f47a53ec \ No newline at end of file +fdab26935842c3462745512106824a5aca147f86d15b7accc9e49c81dbc4bc5a \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 index f278f9f25..f0cca0b40 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 @@ -1 +1 @@ -62f681572cbb7f62690f245583e1ef6dab7d86e49767744c68748b9bdf5fa57a \ No newline at end of file +6cd4ba56fbd2a370764ad0dda37fcdd0dee0f6d7fd08674b2c50f4c103fb38f9 \ No newline at end of file From 6a0779e954c901b2355826d29be0280a9954cfbc Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Fri, 7 Mar 2025 11:32:36 -0600 Subject: [PATCH 20/29] Bump version for release --- CHANGELOG.rst | 3 +++ README.md | 2 +- docs/optional_parsers.rst | 4 ++-- docs/precommit_usage.rst | 44 +++++++++++++++++++-------------------- pyproject.toml | 2 +- 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index deb78797d..0d020d381 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,9 @@ Unreleased .. vendor-insert-here +0.31.3 +------ + - Update vendored schemas: circle-ci, github-workflows, mergify, renovate, taskfile (2025-03-07) diff --git a/README.md b/README.md index ecc10916d..98754e8a7 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ files. ```yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-github-workflows args: ["--verbose"] diff --git a/docs/optional_parsers.rst b/docs/optional_parsers.rst index d0e89f1bc..8f8610c59 100644 --- a/docs/optional_parsers.rst +++ b/docs/optional_parsers.rst @@ -20,7 +20,7 @@ For example, .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-renovate additional_dependencies: ['pyjson5'] @@ -45,7 +45,7 @@ For example, .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-jsonschema name: 'Check GitHub Workflows' diff --git a/docs/precommit_usage.rst b/docs/precommit_usage.rst index aa595af7b..36d5693e4 100644 --- a/docs/precommit_usage.rst +++ b/docs/precommit_usage.rst @@ -17,7 +17,7 @@ You must specify a schema using pre-commit ``args`` configuration. :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-jsonschema files: ^data/.*\.json$ @@ -34,7 +34,7 @@ Validate JSON Schema files against their matching metaschema, as specified in th :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-metaschema files: ^schemas/.*\.json$ @@ -52,7 +52,7 @@ Validate Azure Pipelines config against the schema provided by Microsoft :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-azure-pipelines @@ -66,7 +66,7 @@ Validate Bamboo Specs against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-bamboo-spec @@ -80,7 +80,7 @@ Validate Bitbucket Pipelines against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-bitbucket-pipelines @@ -94,7 +94,7 @@ Validate Buildkite Pipelines against the schema provided by Buildkite :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-buildkite @@ -108,7 +108,7 @@ Validate CircleCI config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-circle-ci @@ -122,7 +122,7 @@ Validate Google Cloud Build config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-cloudbuild @@ -136,7 +136,7 @@ Validate Docker Compose files against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-compose-spec @@ -150,7 +150,7 @@ Validate Dependabot Config (v2) against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-dependabot @@ -164,7 +164,7 @@ Validate Drone-CI Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-drone-ci @@ -178,7 +178,7 @@ Validate GitHub Actions against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-github-actions @@ -192,7 +192,7 @@ Validate GitHub Workflows against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-github-workflows @@ -206,7 +206,7 @@ Validate GitLab CI config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-gitlab-ci @@ -220,7 +220,7 @@ Validate Mergify config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-mergify @@ -234,7 +234,7 @@ Validate ReadTheDocs config against the schema provided by ReadTheDocs :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-readthedocs @@ -248,7 +248,7 @@ Validate Renovate config against the schema provided by Renovate (does not suppo :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-renovate @@ -262,7 +262,7 @@ Validate Taskfile config against the schema provided by Task :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-taskfile @@ -276,7 +276,7 @@ Validate Travis Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-travis @@ -290,7 +290,7 @@ Validate Woodpecker Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-woodpecker-ci @@ -316,7 +316,7 @@ manually, you could do this: .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-jsonschema name: "Check GitHub Workflows" @@ -335,7 +335,7 @@ To check with the builtin schema that a GitHub workflow sets .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-jsonschema name: "Check GitHub Workflows set timeout-minutes" diff --git a/pyproject.toml b/pyproject.toml index 54349b0da..a6bbf7bd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "check-jsonschema" -version = "0.31.2" +version = "0.31.3" description = "A jsonschema CLI and pre-commit hook" authors = [ { name = "Stephen Rosen", email = "sirosen0@gmail.com" }, From f7d9d71aab127d8092daedab8467ce7d724993f0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 08:26:44 -0500 Subject: [PATCH 21/29] [pre-commit.ci] pre-commit autoupdate (#537) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/python-jsonschema/check-jsonschema: 0.31.2 → 0.31.3](https://github.com/python-jsonschema/check-jsonschema/compare/0.31.2...0.31.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .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 56bd27220..47deb7621 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # dogfood - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.2 + rev: 0.31.3 hooks: - id: check-dependabot - id: check-github-workflows From c2edda0281749e381482c2b1f18f794ffa6b21dc Mon Sep 17 00:00:00 2001 From: Fabian Hanke Date: Tue, 11 Mar 2025 16:34:46 +0100 Subject: [PATCH 22/29] add snapcraft vendor schema and pre-commit hook --- .pre-commit-hooks.yaml | 14 + docs/precommit_usage.rst | 14 + docs/usage.rst | 1 + .../vendor/licenses/LICENSE.snapcraft | 674 ++++++++++ .../vendor/sha256/snapcraft.sha256 | 1 + .../builtin_schemas/vendor/snapcraft.json | 1091 +++++++++++++++++ src/check_jsonschema/catalog.py | 10 + tests/acceptance/test_hook_file_matches.py | 4 + .../hooks/negative/snapcraft/snapcraft.yaml | 6 + .../hooks/positive/snapcraft/snapcraft.yaml | 15 + 10 files changed, 1830 insertions(+) create mode 100644 src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.snapcraft create mode 100644 src/check_jsonschema/builtin_schemas/vendor/sha256/snapcraft.sha256 create mode 100644 src/check_jsonschema/builtin_schemas/vendor/snapcraft.json create mode 100644 tests/example-files/hooks/negative/snapcraft/snapcraft.yaml create mode 100644 tests/example-files/hooks/positive/snapcraft/snapcraft.yaml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index afe8005d8..3d8009e67 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -206,6 +206,20 @@ \.renovaterc\.(json|json5) )$ +# this hook is autogenerated from a script +# to modify this hook, update `src/check_jsonschema/catalog.py` +# and run `make generate-hooks` or `tox run -e generate-hooks-config` +- id: check-snapcraft + name: Validate snapcraft files + description: 'Validate snapcraft files against the schema provided by SchemaStore' + entry: check-jsonschema --builtin-schema vendor.snapcraft + language: python + files: > + (?x)^( + ([^/]*/)*snapcraft.yaml + )$ + types: [yaml] + # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` # and run `make generate-hooks` or `tox run -e generate-hooks-config` diff --git a/docs/precommit_usage.rst b/docs/precommit_usage.rst index 36d5693e4..9a2005c14 100644 --- a/docs/precommit_usage.rst +++ b/docs/precommit_usage.rst @@ -253,6 +253,20 @@ Validate Renovate config against the schema provided by Renovate (does not suppo - id: check-renovate +``check-snapcraft`` +~~~~~~~~~~~~~~~~~~~ + +Validate snapcraft files against the schema provided by SchemaStore + +.. code-block:: yaml + :caption: example config + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.31.3 + hooks: + - id: check-snapcraft + + ``check-taskfile`` ~~~~~~~~~~~~~~~~~~ diff --git a/docs/usage.rst b/docs/usage.rst index b5955d55c..c13f08252 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -101,6 +101,7 @@ SchemaStore and other sources: - ``vendor.mergify`` - ``vendor.readthedocs`` - ``vendor.renovate`` +- ``vendor.snapcraft`` - ``vendor.taskfile`` - ``vendor.travis`` - ``vendor.woodpecker-ci`` diff --git a/src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.snapcraft b/src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.snapcraft new file mode 100644 index 000000000..20d40b6bc --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.snapcraft @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/snapcraft.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/snapcraft.sha256 new file mode 100644 index 000000000..92f5d8964 --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/snapcraft.sha256 @@ -0,0 +1 @@ +5284c12e66fcc7fdd171fc211d7d7fb47166e114d5ed69993685e288b0078525 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/snapcraft.json b/src/check_jsonschema/builtin_schemas/vendor/snapcraft.json new file mode 100644 index 000000000..61fedc502 --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/snapcraft.json @@ -0,0 +1,1091 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "definitions": { + "grammar-string": { + "oneOf": [ + { + "type": "string", + "usage": "" + }, + { + "type": "array", + "items": { + "minitems": 1, + "uniqueItems": true, + "oneOf": [ + { + "type": "object", + "usage": "on [,...]:", + "additionalProperties": false, + "patternProperties": { + "^on\\s+.+$": { + "$ref": "#/definitions/grammar-string" + } + } + }, + { + "type": "object", + "usage": "to [,...]:", + "additionalProperties": false, + "patternProperties": { + "^to\\s+.+$": { + "$ref": "#/definitions/grammar-string" + } + } + }, + { + "type": "object", + "usage": "try:", + "additionalProperties": false, + "patternProperties": { + "^try$": { + "$ref": "#/definitions/grammar-string" + } + } + }, + { + "type": "object", + "usage": "else:", + "additionalProperties": false, + "patternProperties": { + "^else$": { + "$ref": "#/definitions/grammar-string" + } + } + }, + { + "type": "string", + "pattern": "else fail" + } + ] + } + } + ] + }, + "grammar-array": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "string", + "usage": "" + }, + { + "type": "object", + "usage": "on [,...]:", + "additionalProperties": false, + "patternProperties": { + "^on\\s+.+$": { + "$ref": "#/definitions/grammar-array" + } + } + }, + { + "type": "object", + "usage": "to [,...]:", + "additionalProperties": false, + "patternProperties": { + "^to\\s+.+$": { + "$ref": "#/definitions/grammar-array" + } + } + }, + { + "type": "object", + "usage": "try:", + "additionalProperties": false, + "patternProperties": { + "^try$": { + "$ref": "#/definitions/grammar-array" + } + } + }, + { + "type": "object", + "usage": "else:", + "additionalProperties": false, + "patternProperties": { + "^else$": { + "$ref": "#/definitions/grammar-array" + } + } + } + ] + } + }, + "build-environment-grammar": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "oneOf": [ + { + "type": "object", + "minProperties": 1, + "maxProperties": 1, + "additionalProperties": { + "type": "string" + } + }, + { + "type": "object", + "usage": "on [,...]:", + "additionalProperties": false, + "patternProperties": { + "^on\\s+.+$": { + "$ref": "#/definitions/build-environment-grammar" + } + } + }, + { + "type": "object", + "usage": "to [,...]:", + "additionalProperties": false, + "patternProperties": { + "^to\\s+.+$": { + "$ref": "#/definitions/build-environment-grammar" + } + } + }, + { + "type": "object", + "usage": "else:", + "additionalProperties": false, + "patternProperties": { + "^else$": { + "$ref": "#/definitions/build-environment-grammar" + } + } + } + ] + } + }, + "apt-deb": { + "type": "object", + "description": "deb repositories", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": ["apt"] + }, + "architectures": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "description": "Architectures to enable, or restrict to, for this repository. Defaults to host architecture." + } + }, + "formats": { + "type": "array", + "description": "deb types to enable. Defaults to [deb, deb-src].", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "enum": ["deb", "deb-src"] + } + }, + "components": { + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string", + "description": "Deb repository components to enable, e.g. 'main, multiverse, unstable'" + } + }, + "key-id": { + "type": "string", + "description": "GPG key identifier / fingerprint. May be used to identify key file in /snap/keys/.asc", + "pattern": "^[A-Z0-9]{40}$" + }, + "key-server": { + "type": "string", + "description": "GPG keyserver to use to fetch GPG , e.g. 'keyserver.ubuntu.com'. Defaults to keyserver.ubuntu.com if key is not found in project." + }, + "path": { + "type": "string", + "description": "Exact path to repository (relative to URL). Cannot be used with suites or components." + }, + "suites": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "description": "Deb repository suites to enable, e.g. 'xenial-updates, xenial-security')." + } + }, + "url": { + "type": "string", + "description": "Deb repository URL, e.g. 'http://archive.canonical.com/ubuntu'." + } + }, + "required": ["type", "key-id", "url"], + "validation-failure": "{!r} is not properly configured deb repository" + }, + "apt-ppa": { + "type": "object", + "description": "PPA repository", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": ["apt"] + }, + "ppa": { + "type": "string", + "description": "ppa path: e.g. 'canonical-kernel-team/unstable'" + } + }, + "required": ["type", "ppa"], + "validation-failure": "{!r} is not properly configured PPA repository" + }, + "system-username-scope": { + "type": "string", + "description": "short-form user configuration (: )", + "enum": ["shared"], + "validation-failure": "{!r} is not a valid user scope. Valid scopes include: 'shared'" + }, + "environment": { + "type": "object", + "description": "environment entries", + "minItems": 1, + "additionalProperties": { + "anyOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "type": "number" + } + ] + } + } + }, + "title": "snapcraft schema", + "type": "object", + "properties": { + "build-packages": { + "$ref": "#/definitions/grammar-array", + "description": "top level build packages." + }, + "adopt-info": { + "type": "string", + "description": "name of the part that provides source files that will be parsed to extract snap metadata information" + }, + "name": { + "description": "name of the snap package", + "allOf": [ + { + "$comment": "string, but not too long. the failure message avoids printing repr of the thing, as it could be huge", + "type": "string", + "validation-failure": "snap names need to be strings.", + "maxLength": 40 + }, + { + "pattern": "^[a-z0-9-]*[a-z][a-z0-9-]*$", + "validation-failure": "{.instance!r} is not a valid snap name. Snap names can only use ASCII lowercase letters, numbers, and hyphens, and must have at least one letter." + }, + { + "pattern": "^[^-]", + "validation-failure": "{.instance!r} is not a valid snap name. Snap names cannot start with a hyphen." + }, + { + "pattern": "[^-]$", + "validation-failure": "{.instance!r} is not a valid snap name. Snap names cannot end with a hyphen." + }, + { + "not": { + "pattern": "--" + }, + "validation-failure": "{.instance!r} is not a valid snap name. Snap names cannot have two hyphens in a row." + } + ] + }, + "title": { + "$comment": "https://forum.snapcraft.io/t/title-length-in-snapcraft-yaml-snap-yaml/8625/10", + "description": "title for the snap", + "type": "string", + "maxLength": 40 + }, + "architectures": { + "description": "architectures on which to build, and on which the resulting snap runs", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "format": "architectures", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "required": ["build-on"], + "properties": { + "build-on": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "minItems": 1, + "uniqueItems": true + } + ] + }, + "run-on": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "minItems": 1, + "uniqueItems": true + } + ] + } + } + } + ] + } + }, + "version": { + "description": "package version", + "allOf": [ + { + "type": "string", + "validation-failure": "snap versions need to be strings. They must also be wrapped in quotes when the value will be interpreted by the YAML parser as a non-string. Examples: '1', '1.2', '1.2.3', git (will be replaced by a git describe based version string)." + }, + { + "pattern": "^[a-zA-Z0-9](?:[a-zA-Z0-9:.+~-]*[a-zA-Z0-9+~])?$", + "maxLength": 32, + "validation-failure": "{.instance!r} is not a valid snap version string. Snap versions consist of upper- and lower-case alphanumeric characters, as well as periods, colons, plus signs, tildes, and hyphens. They cannot begin with a period, colon, plus sign, tilde, or hyphen. They cannot end with a period, colon, or hyphen." + } + ] + }, + "version-script": { + "type": "string", + "description": "a script that echoes the version to set." + }, + "license": { + "type": "string", + "description": "the license the package holds" + }, + "icon": { + "type": "string", + "description": "path to a 512x512 icon representing the package.", + "format": "icon-path" + }, + "summary": { + "type": "string", + "description": "one line summary for the package", + "maxLength": 78 + }, + "description": { + "type": "string", + "description": "long description of the package", + "pattern": ".+", + "validation-failure": "{.instance!r} is not a valid description string." + }, + "assumes": { + "type": "array", + "description": "featureset the snap requires in order to work.", + "minItems": 1, + "uniqueItems": true, + "items": [ + { + "type": "string" + } + ] + }, + "type": { + "type": "string", + "description": "the snap type, the implicit type is 'app'", + "enum": ["app", "base", "gadget", "kernel", "snapd"] + }, + "frameworks": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": [ + { + "type": "string" + } + ] + }, + "confinement": { + "type": "string", + "description": "the type of confinement supported by the snap", + "default": "strict", + "enum": ["classic", "devmode", "strict"] + }, + "grade": { + "type": "string", + "description": "the quality grade of the snap", + "default": "stable", + "enum": ["stable", "devel"] + }, + "base": { + "type": "string", + "description": "the base snap to use" + }, + "build-base": { + "type": "string", + "description": "force a build environment based on base to create a snap" + }, + "epoch": { + "description": "the snap epoch, used to specify upgrade paths", + "format": "epoch" + }, + "compression": { + "description": "compression to use for snap archive - default is otherwise determined by 'snap pack'", + "type": "string", + "enum": ["lzo", "xz"] + }, + "environment": { + "description": "environment entries for the snap as a whole", + "$ref": "#/definitions/environment" + }, + "passthrough": { + "type": "object", + "description": "properties to be passed into snap.yaml as-is" + }, + "layout": { + "type": "object", + "description": "layout property to be passed into the snap.yaml as-is" + }, + "package-repositories": { + "type": "array", + "description": "additional repository configuration.", + "minItems": 0, + "uniqueItems": true, + "items": [ + { + "oneOf": [ + { + "$ref": "#/definitions/apt-deb" + }, + { + "$ref": "#/definitions/apt-ppa" + } + ] + } + ] + }, + "system-usernames": { + "type": "object", + "description": "system username", + "additionalProperties": false, + "validation-failure": "{!r} is not a valid system-username.", + "patternProperties": { + "^snap_(daemon|microk8s|aziotedge|aziotdu)$": { + "oneOf": [ + { + "$ref": "#/definitions/system-username-scope" + }, + { + "type": "object", + "description": "long-form user configuration", + "additionalProperties": false, + "properties": { + "scope": { + "$ref": "#/definitions/system-username-scope" + } + }, + "required": ["scope"] + } + ] + } + } + }, + "donation": { + "oneOf": [ + { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": [ + { + "type": "string" + } + ] + }, + { + "type": "string" + } + ] + }, + "issues": { + "oneOf": [ + { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": [ + { + "type": "string" + } + ] + }, + { + "type": "string" + } + ] + }, + "contact": { + "oneOf": [ + { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": [ + { + "type": "string" + } + ] + }, + { + "type": "string" + } + ] + }, + "source-code": { + "type": "string" + }, + "website": { + "type": "string" + }, + "apps": { + "type": "object", + "additionalProperties": false, + "validation-failure": "{!r} is not a valid app name. App names consist of upper- and lower-case alphanumeric characters and hyphens. They cannot start or end with a hyphen.", + "patternProperties": { + "^[a-zA-Z0-9](?:-?[a-zA-Z0-9])*$": { + "type": "object", + "required": ["command"], + "dependencies": { + "bus-name": ["daemon"], + "activates-on": ["daemon"], + "refresh-mode": ["daemon"], + "stop-mode": ["daemon"], + "stop-command": ["daemon"], + "start-timeout": ["daemon"], + "stop-timeout": ["daemon"], + "watchdog-timeout": ["daemon"], + "restart-delay": ["daemon"], + "post-stop-command": ["daemon"], + "reload-command": ["daemon"], + "restart-condition": ["daemon"], + "before": ["daemon"], + "after": ["daemon"], + "timer": ["daemon"], + "install-mode": ["daemon"] + }, + "additionalProperties": false, + "properties": { + "autostart": { + "type": "string", + "description": "Name of the desktop file placed by the application in $SNAP_USER_DATA/.config/autostart to indicate that application should be started with the user's desktop session.", + "pattern": "^[A-Za-z0-9. _#:$-]+\\.desktop$", + "validation-failure": "{.instance!r} is not a valid desktop file name (e.g. myapp.desktop)" + }, + "common-id": { + "type": "string", + "description": "common identifier across multiple packaging formats" + }, + "bus-name": { + "type": "string", + "description": "D-Bus name this service is reachable as", + "pattern": "^[A-Za-z0-9/. _#:$-]*$", + "validation-failure": "{.instance!r} is not a valid bus name." + }, + "activates-on": { + "type": "array", + "description": "dbus interface slots this service activates on", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "desktop": { + "type": "string", + "description": "path to a desktop file representing the app, relative to the prime directory" + }, + "command": { + "type": "string", + "description": "command executed to run the binary" + }, + "completer": { + "type": "string", + "description": "bash completion script relative to the prime directory" + }, + "stop-command": { + "type": "string", + "description": "command executed to stop a service" + }, + "post-stop-command": { + "type": "string", + "description": "command executed after stopping a service" + }, + "start-timeout": { + "type": "string", + "pattern": "^[0-9]+(ns|us|ms|s|m)*$", + "validation-failure": "{.instance!r} is not a valid timeout value.", + "description": "Optional time to wait for daemon to start - ns | us | ms | s | m" + }, + "stop-timeout": { + "type": "string", + "pattern": "^[0-9]+(ns|us|ms|s|m)*$", + "validation-failure": "{.instance!r} is not a valid timeout value.", + "description": "Optional time to wait for daemon to stop - ns | us | ms | s | m" + }, + "watchdog-timeout": { + "type": "string", + "pattern": "^[0-9]+(ns|us|ms|s|m)*$", + "validation-failure": "{.instance!r} is not a valid timeout value.", + "description": "Service watchdog timeout - ns | us | ms | s | m" + }, + "reload-command": { + "type": "string", + "description": "Command to use to ask the service to reload its configuration." + }, + "restart-delay": { + "type": "string", + "pattern": "^[0-9]+(ns|us|ms|s|m)*$", + "validation-failure": "{.instance!r} is not a valid delay value.", + "description": "Delay between service restarts - ns | us | ms | s | m. Defaults to unset. See the systemd.service manual on RestartSec for details." + }, + "timer": { + "type": "string", + "description": "The service is activated by a timer, app must be a daemon. (systemd.time calendar event string)" + }, + "daemon": { + "type": "string", + "description": "signals that the app is a service.", + "enum": ["simple", "forking", "oneshot", "notify", "dbus"] + }, + "after": { + "type": "array", + "description": "List of applications that are ordered to be started after the current one", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "before": { + "type": "array", + "description": "List of applications that are ordered to be started before the current one", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "refresh-mode": { + "type": "string", + "description": "controls if the app should be restarted at all", + "enum": ["endure", "restart", "ignore-running"] + }, + "stop-mode": { + "type": "string", + "description": "controls how the daemon should be stopped", + "enum": ["sigterm", "sigterm-all", "sighup", "sighup-all", "sigusr1", "sigusr1-all", "sigusr2", "sigusr2-all", "sigint", "sigint-all"] + }, + "restart-condition": { + "type": "string", + "enum": ["on-success", "on-failure", "on-abnormal", "on-abort", "on-watchdog", "always", "never"] + }, + "install-mode": { + "type": "string", + "enum": ["enable", "disable"] + }, + "slots": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "plugs": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "aliases": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^[a-zA-Z0-9][-_.a-zA-Z0-9]*$", + "validation-failure": "{.instance!r} is not a valid alias. Aliases must be strings, begin with an ASCII alphanumeric character, and can only use ASCII alphanumeric characters and the following special characters: . _ -" + } + }, + "environment": { + "description": "environment entries for the specific app.", + "$ref": "#/definitions/environment" + }, + "adapter": { + "$comment": "Full should be the default, but it requires command-chain which isn't available in snapd until 2.36, which isn't yet stable. Until 2.36 is generally available, continue with legacy as the default.", + "type": "string", + "description": "What kind of wrapper to generate for the given command", + "enum": ["none", "legacy", "full"], + "default": "legacy" + }, + "command-chain": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[A-Za-z0-9/._#:$-]*$", + "validation-failure": "{.instance!r} is not a valid command-chain entry. Command chain entries must be strings, and can only use ASCII alphanumeric characters and the following special characters: / . _ # : $ -" + } + }, + "sockets": { + "type": "object", + "additionalProperties": false, + "validation-failure": "{!r} is not a valid socket name. Socket names consist of lower-case alphanumeric characters and hyphens.", + "patternProperties": { + "^[a-z][a-z0-9_-]*$": { + "type": "object", + "required": ["listen-stream"], + "description": "Sockets for automatic service activation", + "additionalProperties": false, + "properties": { + "listen-stream": { + "anyOf": [ + { + "type": "integer", + "usage": "port number, an integer between 1 and 65535", + "minimum": 1, + "maximum": 65535 + }, + { + "type": "string", + "usage": "socket path, a string" + } + ] + }, + "socket-mode": { + "type": "integer" + } + } + } + } + }, + "passthrough": { + "type": "object", + "description": "properties to be passed into snap.yaml as-is" + }, + "extensions": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "enum": ["env-injector", "flutter-stable", "flutter-beta", "flutter-dev", "flutter-master", "gnome", "gnome-3-28", "gnome-3-34", "gnome-3-38", "kde-neon", "kde-neon-6", "ros1-noetic", "ros1-noetic-desktop", "ros1-noetic-perception", "ros1-noetic-robot", "ros1-noetic-ros-base", "ros1-noetic-ros-core", "ros2-foxy", "ros2-foxy-ros-base", "ros2-foxy-ros-core", "ros2-foxy-desktop", "ros2-humble", "ros2-humble-ros-base", "ros2-humble-ros-core", "ros2-humble-desktop"] + } + } + } + } + } + }, + "hooks": { + "type": "object", + "additionalProperties": false, + "validation-failure": "{!r} is not a valid hook name. Hook names consist of lower-case alphanumeric characters and hyphens. They cannot start or end with a hyphen.", + "patternProperties": { + "^[a-z](?:-?[a-z0-9])*$": { + "type": "object", + "additionalProperties": false, + "properties": { + "command-chain": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[A-Za-z0-9/._#:$-]*$", + "validation-failure": "{.instance!r} is not a valid command-chain entry. Command chain entries must be strings, and can only use ASCII alphanumeric characters and the following special characters: / . _ # : $ -" + } + }, + "environment": { + "description": "environment entries for this hook", + "$ref": "#/definitions/environment" + }, + "plugs": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "passthrough": { + "type": "object", + "description": "properties to be passed into snap.yaml as-is" + } + } + } + } + }, + "parts": { + "type": "object", + "minProperties": 1, + "additionalProperties": false, + "validation-failure": "{!r} is not a valid part name. Part names consist of lower-case alphanumeric characters, hyphens and plus signs. As a special case, 'plugins' is also not a valid part name.", + "patternProperties": { + "^(?!plugins$)[a-z0-9][a-z0-9+-]*$": { + "type": ["object", "null"], + "minProperties": 1, + "required": ["plugin"], + "properties": { + "plugin": { + "type": "string", + "description": "plugin name" + }, + "source": { + "$ref": "#/definitions/grammar-string" + }, + "source-checksum": { + "type": "string", + "default": "" + }, + "source-branch": { + "type": "string", + "default": "" + }, + "source-commit": { + "type": "string", + "default": "" + }, + "source-depth": { + "type": "integer", + "default": 0 + }, + "source-submodules": { + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string", + "description": "submodules to fetch, by pathname in source tree" + } + }, + "source-subdir": { + "type": "string", + "default": "" + }, + "source-tag": { + "type": "string", + "default": "" + }, + "source-type": { + "type": "string", + "default": "", + "enum": ["bzr", "git", "hg", "mercurial", "subversion", "svn", "tar", "zip", "deb", "rpm", "7z", "local"] + }, + "disable-parallel": { + "type": "boolean", + "default": false + }, + "after": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string" + }, + "default": [] + }, + "stage-snaps": { + "$comment": "For some reason 'default' doesn't work if in the ref", + "$ref": "#/definitions/grammar-array", + "default": [] + }, + "stage-packages": { + "$comment": "For some reason 'default' doesn't work if in the ref", + "$ref": "#/definitions/grammar-array", + "default": [] + }, + "build-snaps": { + "$comment": "For some reason 'default' doesn't work if in the ref", + "$ref": "#/definitions/grammar-array", + "default": [] + }, + "build-packages": { + "$comment": "For some reason 'default' doesn't work if in the ref", + "$ref": "#/definitions/grammar-array", + "default": [] + }, + "build-environment": { + "$ref": "#/definitions/build-environment-grammar", + "default": [] + }, + "build-attributes": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "enum": ["core22-step-dependencies", "enable-patchelf", "no-patchelf", "no-install", "debug", "keep-execstack"] + }, + "default": [] + }, + "organize": { + "type": "object", + "default": {}, + "additionalProperties": { + "type": "string", + "minLength": 1 + } + }, + "filesets": { + "type": "object", + "default": {}, + "additionalProperties": { + "type": "array", + "minitems": 1 + } + }, + "stage": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string" + }, + "default": ["*"] + }, + "prime": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string" + }, + "default": ["*"] + }, + "override-pull": { + "type": "string", + "default": "snapcraftctl pull" + }, + "override-build": { + "type": "string", + "default": "snapcraftctl build" + }, + "override-stage": { + "type": "string", + "default": "snapcraftctl stage" + }, + "override-prime": { + "type": "string", + "default": "snapcraftctl prime" + }, + "parse-info": { + "type": "array", + "minitems": 1, + "uniqueItems": true, + "items": { + "type": "string" + }, + "default": [] + } + } + } + } + }, + "plugs": { + "type": "object" + }, + "slots": { + "type": "object" + }, + "ua-services": { + "type": "array", + "description": "UA services to enable.", + "minItems": 1, + "uniqueItems": true, + "items": [ + { + "type": "string" + } + ] + } + }, + "allOf": [ + { + "anyOf": [ + { + "usage": "type: (without a base)", + "properties": { + "type": { + "enum": ["base", "kernel", "snapd"] + } + }, + "allOf": [ + { + "required": ["type"] + }, + { + "not": { + "required": ["base"] + } + } + ] + }, + { + "usage": "base: and type: ", + "properties": { + "type": { + "enum": ["app", "gadget"] + } + }, + "allOf": [ + { + "required": ["base"] + } + ] + }, + { + "usage": "base: bare (with a build-base)", + "properties": { + "base": { + "enum": ["bare"] + } + }, + "required": ["build-base"] + } + ] + }, + { + "anyOf": [ + { + "required": ["summary", "description", "version"] + }, + { + "required": ["adopt-info"] + } + ] + } + ], + "required": ["name", "parts"], + + "dependencies": { + "license-agreement": ["license"], + "license-version": ["license"] + }, + "additionalProperties": false +} diff --git a/src/check_jsonschema/catalog.py b/src/check_jsonschema/catalog.py index dcbcf3c58..4c2972bc4 100644 --- a/src/check_jsonschema/catalog.py +++ b/src/check_jsonschema/catalog.py @@ -212,6 +212,16 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: ], }, }, + "snapcraft": { + "url": _githubusercontent_url( + "canonical", "snapcraft", "main", "schema/snapcraft.json" + ), + "hook_config": { + "name": "Validate snapcraft files", + "files": [r"([^/]*/)*snapcraft.yaml"], + "types": "yaml", + }, + }, "taskfile": { "url": "https://taskfile.dev/schema.json", "hook_config": { diff --git a/tests/acceptance/test_hook_file_matches.py b/tests/acceptance/test_hook_file_matches.py index d6660122c..d96f596b4 100644 --- a/tests/acceptance/test_hook_file_matches.py +++ b/tests/acceptance/test_hook_file_matches.py @@ -140,6 +140,10 @@ def get_hook_config(hookid): ".renovate.json", ), }, + "check-snapcraft": { + "good": ("snapcraft.yaml", "snap/snapcraft.yaml", "foo/bar/snapcraft.yaml"), + "bad": ("snapcraft.yml", "snap.yaml", "snapcraft"), + }, "check-travis": { "good": ( ".travis.yml", diff --git a/tests/example-files/hooks/negative/snapcraft/snapcraft.yaml b/tests/example-files/hooks/negative/snapcraft/snapcraft.yaml new file mode 100644 index 000000000..42077d638 --- /dev/null +++ b/tests/example-files/hooks/negative/snapcraft/snapcraft.yaml @@ -0,0 +1,6 @@ +name: broken +base: core22 +version: '1.2' +summary: Broken snap file +description: | + Broken snap file which is missing a parts block. diff --git a/tests/example-files/hooks/positive/snapcraft/snapcraft.yaml b/tests/example-files/hooks/positive/snapcraft/snapcraft.yaml new file mode 100644 index 000000000..9258e2e7d --- /dev/null +++ b/tests/example-files/hooks/positive/snapcraft/snapcraft.yaml @@ -0,0 +1,15 @@ +name: hello +base: core22 +version: '2.10' +summary: GNU Hello, the "hello world" snap +description: | + GNU hello prints a friendly greeting. +grade: stable +confinement: strict +apps: + hello: + command: bin/hello +parts: + gnu-hello: + source: http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz + plugin: autotools \ No newline at end of file From 3c346845852d60471e00592682df247f2802b26a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Wed, 19 Mar 2025 14:42:14 -0600 Subject: [PATCH 23/29] Add Meltano schema and pre-commit hook --- .pre-commit-hooks.yaml | 16 + CHANGELOG.rst | 2 + docs/precommit_usage.rst | 14 + docs/usage.rst | 3 +- .../vendor/licenses/LICENSE.meltano | 7 + .../builtin_schemas/vendor/meltano.json | 1239 +++++++++++++++++ .../vendor/sha256/meltano.sha256 | 1 + src/check_jsonschema/catalog.py | 20 + tests/acceptance/test_hook_file_matches.py | 14 + .../positive/meltano/multiple-plugins.yml | 54 + 10 files changed, 1369 insertions(+), 1 deletion(-) create mode 100644 src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.meltano create mode 100644 src/check_jsonschema/builtin_schemas/vendor/meltano.json create mode 100644 src/check_jsonschema/builtin_schemas/vendor/sha256/meltano.sha256 create mode 100644 tests/example-files/hooks/positive/meltano/multiple-plugins.yml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index afe8005d8..bf01e3227 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -163,6 +163,22 @@ files: ^.*\.gitlab-ci\.yml$ types: [yaml] +# this hook is autogenerated from a script +# to modify this hook, update `src/check_jsonschema/catalog.py` +# and run `make generate-hooks` or `tox run -e generate-hooks-config` +- id: check-meltano + name: Validate Meltano Config + description: 'Validate Meltano config against the schema provided by Meltano' + entry: check-jsonschema --builtin-schema vendor.meltano + language: python + files: > + (?x)^( + .*meltano\.yml| + meltano-manifest\.json| + meltano-manifest\..+\.json + )$ + types: [json,yaml] + # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` # and run `make generate-hooks` or `tox run -e generate-hooks-config` diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0d020d381..e620e5456 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,8 @@ Unreleased .. vendor-insert-here +- Add Meltano schema and pre-commit hook (:issue:`540`). + 0.31.3 ------ diff --git a/docs/precommit_usage.rst b/docs/precommit_usage.rst index 36d5693e4..9ce2bdd17 100644 --- a/docs/precommit_usage.rst +++ b/docs/precommit_usage.rst @@ -211,6 +211,20 @@ Validate GitLab CI config against the schema provided by SchemaStore - id: check-gitlab-ci +``check-meltano`` +~~~~~~~~~~~~~~~~~ + +Validate Meltano config against the schema provided by Meltano + +.. code-block:: yaml + :caption: example config + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.31.3 + hooks: + - id: check-meltano + + ``check-mergify`` ~~~~~~~~~~~~~~~~~ diff --git a/docs/usage.rst b/docs/usage.rst index b5955d55c..bb0da0b35 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -98,6 +98,7 @@ SchemaStore and other sources: - ``vendor.github-actions`` - ``vendor.github-workflows`` - ``vendor.gitlab-ci`` +- ``vendor.meltano`` - ``vendor.mergify`` - ``vendor.readthedocs`` - ``vendor.renovate`` @@ -185,7 +186,7 @@ Example usage: --disable-formats time,date-time --disable-formats iri ``--regex-variant`` -~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~ Set a mode for handling of the ``"regex"`` value for ``"format"`` and the mode for ``"pattern"`` and ``"patternProperties"`` interpretation. diff --git a/src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.meltano b/src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.meltano new file mode 100644 index 000000000..a50e441e6 --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/licenses/LICENSE.meltano @@ -0,0 +1,7 @@ +Copyright Arch Data, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/check_jsonschema/builtin_schemas/vendor/meltano.json b/src/check_jsonschema/builtin_schemas/vendor/meltano.json new file mode 100644 index 000000000..96ec5305e --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/meltano.json @@ -0,0 +1,1239 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://meltano.com/meltano.schema.json", + "title": "JSON Schema for meltano.yml", + "description": "Meltano (https://meltano.com) is an open source platform for building, running & orchestrating ELT pipelines", + "type": "object", + "additionalProperties": false, + "properties": { + "version": { + "const": 1 + }, + "annotations": { + "$ref": "#/$defs/annotations" + }, + "default_environment": { + "type": "string", + "description": "A default environment to be used when one is not present as an argument or as an environment variable." + }, + "send_anonymous_usage_stats": { + "type": "boolean", + "description": "Share anonymous usage data with the Meltano team to help them gauge interest and allocate development time", + "default": true + }, + "project_id": { + "type": "string", + "description": "A globally unique project identifier. Defaults to a Meltano-generated unique GUID for each project." + }, + "database_uri": { + "type": "string", + "description": "A database URI for the project system database. Defaults to a SQLite file stored at .meltano/meltano.db", + "default": "sqlite:///$MELTANO_PROJECT_ROOT/.meltano/meltano.db" + }, + "python": { + "type": "string", + "description": "The python version to use for plugins, specified as a path, or as the name of an executable to find within a directory in $PATH. If not specified, the python executable that was used to run Meltano will be used (within a separate virtual environment). This can be overridden on a per-plugin basis by setting the `python` property for the plugin.", + "examples": [ + "/usr/bin/python3.10", + "python", + "python3.11" + ] + }, + "state_backend": { + "type": "object", + "description": "Configuration for state backend.", + "properties": { + "uri": { + "type": "string", + "description": "The URI pointing to the backend to use.", + "default": "systemdb" + }, + "lock_timeout_seconds": { + "type": "integer", + "description": "The number of seconds a lock on a state file is considered valid." + }, + "lock_retry_seconds": { + "type": "integer", + "description": "The number of seconds to wait between retrying lock acquisition." + }, + "azure": { + "type": "object", + "description": "Configuration for Azure Blob Storage state backend.", + "properties": { + "connection_string": { + "type": "string", + "description": "The azure connection string to use for connecting to Azure Blob Storage." + } + } + }, + "gcs": { + "type": "object", + "description": "Configuration for Google Cloud Storage state backend.", + "properties": { + "application_credentials": { + "type": "string", + "description": "Path to a Google credentials file to use for authenticating to Google Cloud Storage." + } + } + }, + "s3": { + "type": "object", + "description": "Configuration for AWS S3 state backend.", + "properties": { + "aws_access_key_id": { + "type": "string", + "description": "AWS access key ID to use for authenticating to AWS S3." + }, + "aws_secret_access_key": { + "type": "string", + "description": "AWS secret access key to use for authenticating to AWS S3." + }, + "endpoint_url": { + "type": "string", + "description": "S3 endpoint URL to use." + } + } + } + } + }, + "venv": { + "type": "object", + "description": "Configuration for plugin virtual environments.", + "properties": { + "backend": { + "type": "string", + "description": "The virtual environment backend to use.", + "default": "virtualenv", + "enum": [ + "virtualenv", + "uv" + ] + } + } + }, + "environments": { + "type": "array", + "description": "An array of environments (i.e. dev, stage, prod) with override configs for plugins based on the environment its run in.", + "items": { + "$ref": "#/$defs/environments" + } + }, + "include_paths": { + "type": "array", + "description": "An array of paths (relative to the project directory) of other Meltano config files to include in the configuration.", + "items": { + "type": "string" + } + }, + "plugins": { + "type": "object", + "additionalProperties": false, + "properties": { + "extractors": { + "type": "array", + "items": { + "$ref": "#/$defs/plugins/extractors" + } + }, + "loaders": { + "type": "array", + "items": { + "$ref": "#/$defs/plugins/loaders" + } + }, + "mappers": { + "type": "array", + "items": { + "$ref": "#/$defs/plugins/mappers" + } + }, + "orchestrators": { + "type": "array", + "items": { + "$ref": "#/$defs/plugins/orchestrators" + } + }, + "transformers": { + "type": "array", + "items": { + "$ref": "#/$defs/plugins/transformers" + } + }, + "files": { + "type": "array", + "items": { + "$ref": "#/$defs/plugins/files" + } + }, + "utilities": { + "type": "array", + "items": { + "$ref": "#/$defs/plugins/utilities" + } + }, + "transforms": { + "type": "array", + "items": { + "$ref": "#/$defs/plugins/transforms" + } + } + } + }, + "schedules": { + "type": "array", + "items": { + "$ref": "#/$defs/schedules" + }, + "description": "Scheduled ELT jobs, added using 'meltano schedule'" + }, + "env": { + "$ref": "#/$defs/env" + }, + "jobs": { + "type": "array", + "items": { + "$ref": "#/$defs/jobs" + }, + "description": "Jobs, added using 'meltano job'" + }, + "database_max_retries": { + "type": "integer", + "description": "The number of times to retry connecting to the Meltano database.", + "default": 3, + "minimum": 0 + }, + "database_retry_timeout": { + "type": "integer", + "description": "The time in seconds to wait between Meltano database connection attempts.", + "default": 5, + "minimum": 0 + }, + "project_readonly": { + "type": "boolean", + "description": "Whether the project is read-only.", + "default": false + }, + "cli": { + "type": "object", + "description": "CLI related settings.", + "properties": { + "log_config": { + "type": "string", + "description": "The path to the logging config, relative to the Meltano project root.", + "default": "logging.yaml" + } + } + }, + "elt": { + "type": "object", + "description": "ELT related settings", + "properties": { + "buffer_size": { + "type": "integer", + "description": "The size of the ELT buffer in bytes.", + "default": 10485760 + } + } + }, + "experimental": { + "type": "boolean", + "description": "Whether experimental features should be enabled.", + "default": false + }, + "ff": { + "type": "object", + "description": "A feature flag, which can be used to enable or disable particular Meltano features.", + "properties": { + "strict_env_var_mode": { + "type": "boolean", + "description": "Whether references to undefined environment variables cause Meltano to exit with an error.", + "default": false + }, + "plugin_locks_required": { + "type": "boolean", + "description": "Whether plugin locks are required to run a job.", + "default": false + } + } + }, + "hub_api_root": { + "type": [ + "string", + "null" + ], + "description": "The URL to the root of the Meltano Hub API.", + "default": null, + "examples": [ + "https://hub.meltano.com/meltano/api/v1" + ] + }, + "hub_url": { + "type": "string", + "description": "The URL for Meltano Hub.", + "default": "https://hub.meltano.com" + }, + "hub_url_auth": { + "type": [ + "string", + "boolean", + "null" + ], + "description": "The value of the `Authorization` header when making requests to Meltano Hub. If null, false, or unset, no `Authorization` header is used.", + "default": null, + "examples": [ + "Bearer $ACCESS_TOKEN" + ] + }, + "snowplow": { + "type": "object", + "description": "Snowplow related settings.", + "properties": { + "collector_endpoints": { + "type": "array", + "description": "Array of Snowplow collector endpoints.", + "items": { + "type": "string", + "description": "A URL to which Snowplow events will be sent if telemetry is enabled." + }, + "default": [ + "https://sp.meltano.com" + ] + } + } + }, + "auto_install": { + "type": "boolean", + "description": "Whether to automatically install any required plugins on command invocation. A plugin will be auto-installed when its virtual environment does not already exist or `pip_url` is changed.", + "default": true + } + }, + "$defs": { + "annotations": { + "type": "object", + "description": "Arbitrary annotations keyed by tool/vendor name - not processed by the core Meltano library or CLI", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "object" + } + }, + "plugins": { + "plugin_generic": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "name": { + "type": "string", + "description": "The name of the plugin.", + "examples": [ + "target-jsonl" + ] + }, + "description": { + "type": "string", + "description": "A description of the plugin." + }, + "plugin_type": { + "type": "string", + "description": "The type of the plugin.", + "enum": [ + "extractors", + "loaders", + "orchestrators", + "transformers", + "files", + "utilities", + "transforms", + "mappers" + ] + }, + "repo": { + "type": "string", + "description": "The URL of the repository containing the source code for the plugin." + }, + "ext_repo": { + "type": "string", + "description": "The URL of the repository containing the source code for a Meltano extension plugin that typically wraps some other tool, in which case the 'repo' property is used for the URL of the repository for that tool." + }, + "inherit_from": { + "type": "string", + "description": "An existing plugin to inherit from." + }, + "pip_url": { + "type": "string", + "description": "The pip hosted package name or URL", + "examples": [ + "target-jsonl", + "git+https://gitlab.com/meltano/tap-facebook.git", + "wtforms==2.2.1 apache-airflow==1.10.2" + ] + }, + "variant": { + "type": "string", + "description": "The variant of the plugin." + }, + "namespace": { + "type": "string", + "description": "The namespace of this plugin", + "examples": [ + "tap_csv", + "target_jsonl" + ] + }, + "config": { + "type": "object", + "description": "Your plugin configuration, type 'meltano config list' for details" + }, + "label": { + "type": "string", + "description": "A user friendly label describing the plugin", + "examples": [ + "Stripe", + "Facebook Ads" + ] + }, + "logo_url": { + "type": "string", + "description": "An optional logo URL for this plugin" + }, + "python": { + "type": "string", + "description": "The python version to use for this plugin, specified as a path, or as the name of an executable to find within a directory in $PATH. If not specified, the top-level `python` setting will be used, or if it is not set, the python executable that was used to run Meltano will be used (within a separate virtual environment).", + "examples": [ + "/usr/bin/python3.10", + "python", + "python3.11" + ] + }, + "executable": { + "type": "string", + "description": "The plugin's executable name, as defined in setup.py (if a Python based plugin)", + "examples": [ + "tap-stripe", + "tap-covid-19" + ] + }, + "settings": { + "type": "array", + "items": { + "$ref": "#/$defs/base_setting" + } + }, + "docs": { + "type": "string", + "description": "A URL to the documentation for this plugin" + }, + "settings_group_validation": { + "type": "array", + "items": { + "type": "array", + "description": "A set consisting of one valid combination of required setting names", + "items": { + "type": "string" + } + } + }, + "commands": { + "type": "object", + "description": "A mapping of command names to either a string command, or an object containing info about the command.", + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "args": { + "type": "string", + "description": "Command arguments" + }, + "description": { + "type": "string", + "description": "Documentation displayed when listing commands" + }, + "executable": { + "type": "string", + "description": "Override the plugin's executable for this command" + }, + "container_spec": { + "type": "object", + "required": [ + "image" + ], + "description": "Container specification for this command", + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "image": { + "type": "string", + "description": "Container image", + "examples": [ + "ghcr.io/dbt-labs/dbt-postgres:latest" + ] + }, + "command": { + "type": "string", + "description": "Container command", + "examples": [ + "list", + "test", + "compile" + ] + }, + "entrypoint": { + "type": "string", + "description": "Container entrypoint" + }, + "ports": { + "type": "object", + "description": "Mapping of host to container ports", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "string" + }, + "examples": [ + { + "5000": "5000" + } + ] + }, + "volumes": { + "type": "array", + "description": "Array of volumes to mount during container execution", + "items": { + "type": "string", + "examples": [ + "$MELTANO_PROJECT_ROOT/transform/:/usr/app/" + ] + } + }, + "env": { + "type": "object", + "description": "Mapping to environment variable to set inside the container. These take precedence over Meltano own runtime environment variables.", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "string" + }, + "examples": [ + { + "DBT_PROFILES_DIR": "/usr/app/profile/" + } + ] + } + } + } + } + }, + { + "type": "string", + "description": "The command as a string." + } + ] + } + }, + "requires": { + "$ref": "#/$defs/requires" + }, + "env": { + "$ref": "#/$defs/env" + } + } + }, + "extractor_shared": { + "type": "object", + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "catalog": { + "type": "string", + "description": "A path to a catalog file (relative to the project directory) to be provided to the extractor when it is run in sync mode." + }, + "load_schema": { + "type": "string", + "description": "The name of the database schema extracted data should be loaded into." + }, + "metadata": { + "type": "object", + "description": "An object containing Singer stream and property metadata", + "default": {} + }, + "schema": { + "type": "object", + "description": "An object representing override rules for a Singer stream schema", + "default": {} + }, + "state": { + "type": "string", + "description": "A path to a state file (relative to the project directory) to be provided to the extractor when it is run as part of a pipeline using meltano elt." + }, + "select": { + "type": "array", + "default": [ + "*.*" + ], + "description": "An array of entity selection rules in the form '.'", + "items": { + "type": "string" + } + }, + "select_filter": { + "type": "array", + "description": "An array of entity selection filter rules that are applied to the extractor's discovered or provided catalog file when the extractor is run.", + "items": { + "type": "string" + }, + "default": [] + }, + "use_cached_catalog": { + "type": "boolean", + "description": "A boolean that determines if the catalog cache should be used or ignored.", + "default": true + } + } + }, + "extractors": { + "description": "https://docs.meltano.com/concepts/plugins#extractors", + "type": "object", + "allOf": [ + { + "$ref": "#/$defs/plugins/plugin_generic" + }, + { + "$ref": "#/$defs/plugins/extractor_shared" + }, + { + "type": "object", + "properties": { + "capabilities": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "properties", + "catalog", + "discover", + "state", + "about", + "stream-maps", + "activate-version", + "batch", + "test", + "log-based", + "schema-flattening" + ] + } + } + } + } + ], + "unevaluatedProperties": false + }, + "loaders": { + "description": "https://docs.meltano.com/concepts/plugins#loaders", + "type": "object", + "allOf": [ + { + "$ref": "#/$defs/plugins/plugin_generic" + }, + { + "properties": { + "capabilities": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "about", + "stream-maps", + "activate-version", + "batch", + "soft-delete", + "hard-delete", + "datatype-failsafe", + "schema-flattening" + ] + } + }, + "dialect": { + "type": "string", + "description": "The name of the dialect of the target database, so that transformers in the same pipeline can determine the type of database to connect to." + } + } + } + ], + "unevaluatedProperties": false + }, + "orchestrators": { + "description": "https://docs.meltano.com/concepts/plugins#orchestrators", + "type": "object", + "$ref": "#/$defs/plugins/plugin_generic", + "unevaluatedProperties": false + }, + "transformers": { + "description": "https://docs.meltano.com/concepts/plugins#transforms", + "type": "object", + "$ref": "#/$defs/plugins/plugin_generic", + "unevaluatedProperties": false + }, + "files": { + "description": "https://docs.meltano.com/concepts/plugins#file-bundles", + "type": "object", + "$ref": "#/$defs/plugins/plugin_generic", + "unevaluatedProperties": false + }, + "utilities": { + "description": "https://docs.meltano.com/concepts/plugins#utilities", + "type": "object", + "$ref": "#/$defs/plugins/plugin_generic", + "unevaluatedProperties": false + }, + "transforms": { + "description": "https://docs.meltano.com/concepts/plugins#transforms", + "type": "object", + "allOf": [ + { + "$ref": "#/$defs/plugins/plugin_generic" + }, + { + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "vars": { + "type": "object", + "description": "An object containing dbt model variables" + }, + "package_name": { + "type": "string", + "description": "The name of the dbt package's internal dbt project: the value of name in dbt_project.yml." + } + } + } + ], + "unevaluatedProperties": false + }, + "mapper_specific": { + "type": "object", + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "mappings": { + "description": "Name of the invokable mappings and their associated configs.", + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "name": { + "type": "string" + }, + "config": { + "type": "object" + } + } + }, + "required": [ + "config", + "name" + ] + } + } + }, + "mappers": { + "description": "https://docs.meltano.com/concepts/plugins#mappers", + "type": "object", + "allOf": [ + { + "$ref": "#/$defs/plugins/plugin_generic" + }, + { + "$ref": "#/$defs/plugins/mapper_specific" + } + ], + "unevaluatedProperties": false + } + }, + "base_setting": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": false, + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "name": { + "type": "string", + "description": "The name of the setting", + "examples": [ + "account_id" + ] + }, + "aliases": { + "type": "array", + "description": "Alternative setting names that can be used in 'meltano.yml' and 'meltano config set'", + "examples": [ + "accountId", + "account_identifier" + ], + "items": { + "type": "string" + } + }, + "label": { + "type": "string", + "description": "A user friendly label for the setting", + "examples": [ + "Account ID" + ] + }, + "value": { + "description": "The default value of this setting if not otherwise defined" + }, + "placeholder": { + "type": "string", + "description": "A placeholder value for this setting", + "examples": [ + "Ex. 18161" + ] + }, + "kind": { + "type": "string", + "description": "The type of value this setting contains", + "oneOf": [ + { + "enum": [ + "oauth", + "date_iso8601", + "file", + "email", + "integer", + "options", + "object", + "array", + "boolean", + "string" + ] + }, + { + "enum": [ + "hidden", + "password" + ], + "deprecated": true + } + ] + }, + "description": { + "type": "string", + "description": "A description for what this setting does", + "examples": [ + "The unique account identifier for your Stripe Account" + ] + }, + "tooltip": { + "type": "string", + "description": "A phrase to provide additional information on this setting", + "examples": [ + "Here is some additional info..." + ] + }, + "documentation": { + "type": "string", + "description": "A link to documentation on this setting", + "examples": [ + "https://meltano.com/" + ] + }, + "hidden": { + "type": "boolean", + "description": "A hidden setting should not be user-configurable", + "default": false + }, + "sensitive": { + "type": "boolean", + "description": "A sensitive setting is redacted in command output", + "default": false + }, + "env": { + "type": "string", + "description": "An alternative environment variable name to populate with this settings value in the plugin environment.", + "examples": [ + "GITLAB_API_TOKEN", + "FACEBOOK_ADS_ACCESS_TOKEN" + ] + }, + "value_processor": { + "description": "Use with `kind: object` to pre-process the keys in a particular way.", + "enum": [ + "nest_object", + "upcase_string" + ] + }, + "value_post_processor": { + "oneOf": [ + { + "const": "nest_object", + "description": "Convert a flat object with period-delimited keys to a nested object" + }, + { + "const": "upcase_string", + "description": "Convert the setting value to uppercase" + }, + { + "const": "stringify", + "description": "Convert the JSON object to a string" + }, + { + "const": "parse_date", + "description": "Parse the setting value as a date" + } + ] + }, + "oauth": { + "type": "object", + "required": [ + "provider" + ], + "properties": { + "provider": { + "type": "string", + "description": "The name of a Meltano-supported OAuth provider", + "examples": [ + "google-adwords" + ] + } + } + }, + "options": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string", + "description": "A user friendly label for the option", + "examples": [ + "Account ID" + ] + }, + "value": { + "description": "The value of this option" + } + }, + "required": [ + "label", + "value" + ], + "additionalProperties": false + } + } + } + }, + "schedules": { + "type": "object", + "oneOf": [ + { + "required": [ + "name", + "job", + "interval" + ] + }, + { + "required": [ + "name", + "extractor", + "loader", + "transform", + "interval", + "start_date" + ] + } + ], + "description": "https://docs.meltano.com/guide/orchestration", + "additionalProperties": false, + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "name": { + "type": "string", + "description": "The schedule's unique name", + "examples": [ + "gitlab-to-jsonl" + ] + }, + "job": { + "type": "string", + "description": "The name of a meltano job", + "examples": [ + "some-custom-job" + ] + }, + "extractor": { + "type": "string", + "description": "The name of the extractor plugin", + "examples": [ + "tap-gitlab" + ] + }, + "env": { + "$ref": "#/$defs/env" + }, + "loader": { + "type": "string", + "description": "The name of the loader plugin", + "examples": [ + "target-jsonl" + ] + }, + "interval": { + "type": "string", + "description": "A UNIX cron expression to represent the frequency the scheduled job should execute", + "examples": [ + "@hourly", + "@daily", + "@weekly", + "0 0 * * *" + ], + "pattern": "^((@(hourly|daily|weekly|monthly|yearly|once))|((((\\d+,)+\\d+|(\\d+|\\*)(\\/|-)\\d+|\\d+|\\*) ?){5,6}))$" + }, + "transform": { + "type": "string", + "description": "Describes if transforms should run, be skipped, or if only transforms should execute (skip extractors and loaders)", + "default": "skip", + "enum": [ + "run", + "skip", + "only" + ] + }, + "start_date": { + "type": "string", + "description": "The date when the schedule should first execute", + "examples": [ + "2020-08-06 00:00:00" + ] + } + } + }, + "jobs": { + "type": "object", + "required": [ + "name", + "tasks" + ], + "description": "https://docs.meltano.com/reference/command-line-interface#job", + "additionalProperties": false, + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "name": { + "type": "string", + "description": "This jobs unique name", + "examples": [ + "gitlab-to-jsonl" + ] + }, + "tasks": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + ] + } + } + }, + "environments": { + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "name": { + "type": "string", + "description": "The name of the environment." + }, + "config": { + "type": "object", + "description": "An object of environment specific configurations.", + "additionalProperties": false, + "properties": { + "plugins": { + "type": "object", + "description": "An object of environment specific plugin configurations.", + "properties": { + "extractors": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/$defs/environments/$defs/plugins" + }, + { + "$ref": "#/$defs/plugins/extractor_shared" + } + ], + "unevaluatedProperties": false + } + }, + "loaders": { + "type": "array", + "items": { + "unevaluatedProperties": false, + "$ref": "#/$defs/environments/$defs/plugins" + } + }, + "orchestrators": { + "type": "array", + "items": { + "unevaluatedProperties": false, + "$ref": "#/$defs/environments/$defs/plugins" + } + }, + "transformers": { + "type": "array", + "items": { + "unevaluatedProperties": false, + "$ref": "#/$defs/environments/$defs/plugins" + } + }, + "files": { + "type": "array", + "items": { + "unevaluatedProperties": false, + "$ref": "#/$defs/environments/$defs/plugins" + } + }, + "utilities": { + "type": "array", + "items": { + "unevaluatedProperties": false, + "$ref": "#/$defs/environments/$defs/plugins" + } + }, + "transforms": { + "type": "array", + "items": { + "unevaluatedProperties": false, + "$ref": "#/$defs/environments/$defs/plugins" + } + } + } + } + } + }, + "env": { + "$ref": "#/$defs/env" + } + }, + "$defs": { + "plugins": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "name": { + "type": "string" + }, + "config": { + "type": "object" + }, + "env": { + "$ref": "#/$defs/env" + } + } + } + } + }, + "requires": { + "type": "object", + "description": "A set of plugin requirements.", + "additionalProperties": false, + "patternProperties": { + "^(extractors|loaders|transforms|orchestrators|transformers|files|utilities|mappers)$": { + "type": "array", + "items": { + "$ref": "#/$defs/plugin_requirement" + } + } + } + }, + "plugin_requirement": { + "type": "object", + "description": "A single plugin requirement", + "additionalProperties": false, + "properties": { + "annotations": { + "$ref": "#/$defs/annotations" + }, + "name": { + "type": "string", + "description": "The name of the required plugin" + }, + "variant": { + "type": "string", + "description": "The variant of the required plugin" + } + } + }, + "env": { + "type": "object", + "description": "Mapping of environment variables for use in config.", + "propertyNames": { + "type": "string" + }, + "additionalProperties": { + "type": "string" + }, + "examples": [ + { + "SNOWFLAKE_ACCOUNT": "my.snowflake.account.com" + } + ] + } + } +} diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/meltano.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/meltano.sha256 new file mode 100644 index 000000000..df087f1ee --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/meltano.sha256 @@ -0,0 +1 @@ +4c0239109ae72a02005fc5c8aef74b3b0298cc98684a00de87b600f45484d7b3 \ No newline at end of file diff --git a/src/check_jsonschema/catalog.py b/src/check_jsonschema/catalog.py index dcbcf3c58..4e2c92849 100644 --- a/src/check_jsonschema/catalog.py +++ b/src/check_jsonschema/catalog.py @@ -166,6 +166,26 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: "types": "yaml", }, }, + "meltano": { + "url": _githubusercontent_url( + "meltano", + "meltano", + "main", + "src/meltano/schemas/meltano.schema.json", + ), + "hook_config": { + "name": "Validate Meltano Config", + "description": ( + "Validate Meltano config against the schema provided by Meltano" + ), + "files": [ + r".*meltano\.yml", + r"meltano-manifest\.json", + r"meltano-manifest\..+\.json", + ], + "types": ["json", "yaml"], + }, + }, "mergify": { "url": "https://docs.mergify.com/mergify-configuration-schema.json", "hook_config": { diff --git a/tests/acceptance/test_hook_file_matches.py b/tests/acceptance/test_hook_file_matches.py index d6660122c..cc0628b3a 100644 --- a/tests/acceptance/test_hook_file_matches.py +++ b/tests/acceptance/test_hook_file_matches.py @@ -79,6 +79,20 @@ def get_hook_config(hookid): "Dockerfile", ), }, + "check-meltano": { + "good": ( + "meltano.yml", + "data/meltano.yml", + "extractors.meltano.yml", + "meltano-manifest.json", + "meltano-manifest.prod.json", + ), + "bad": ( + "meltano.yaml", + "meltano.yml.md", + "meltano-manifest.yml", + ), + }, "check-dependabot": { "good": (".github/dependabot.yml", ".github/dependabot.yaml"), "bad": (".dependabot.yaml", ".dependabot.yml"), diff --git a/tests/example-files/hooks/positive/meltano/multiple-plugins.yml b/tests/example-files/hooks/positive/meltano/multiple-plugins.yml new file mode 100644 index 000000000..d28bcb738 --- /dev/null +++ b/tests/example-files/hooks/positive/meltano/multiple-plugins.yml @@ -0,0 +1,54 @@ +version: 1 +env: + DBT_CLEAN_PROJECT_FILES_ONLY: 'false' +venv: + backend: uv +default_environment: dev +project_id: 90f75496-2018-4b3a-97ac-9662e11c0094 +send_anonymous_usage_stats: false +plugins: + extractors: + - name: tap-gitlab + variant: meltanolabs + pip_url: git+https://github.com/MeltanoLabs/tap-gitlab.git + loaders: + - name: target-postgres + variant: transferwise + pip_url: > + git+https://github.com/transferwise/pipelinewise.git#subdirectory=singer-connectors/target-postgres + utilities: + - name: dbt-postgres + variant: dbt-labs + pip_url: dbt-core dbt-postgres meltano-dbt-ext~=0.3.0 +environments: +- name: dev + config: + plugins: + extractors: + - name: tap-gitlab + config: + projects: meltano/meltano + start_date: '2022-04-25T00:00:00' + select: + - commits.* + - '!commits.stats.commits.stats*' + loaders: + - name: target-postgres + config: + user: postgres + dbname: warehouse + default_target_schema: public + utilities: + - name: dbt-postgres + config: + host: localhost + user: postgres + port: 5432 + dbname: warehouse + schema: analytics +- name: staging +- name: prod +jobs: +- name: gitlab-to-postgres + tasks: + - tap-gitlab target-postgres From 43ad2ebc7c3f6f5a90f9f77a044a2447444ae05c Mon Sep 17 00:00:00 2001 From: sirosen <1300022+sirosen@users.noreply.github.com> Date: Sun, 23 Mar 2025 04:26:54 +0000 Subject: [PATCH 24/29] [vendor-schemas] automated update --- CHANGELOG.rst | 3 + .../builtin_schemas/vendor/circle-ci.json | 2 +- .../builtin_schemas/vendor/compose-spec.json | 55 +-- .../builtin_schemas/vendor/dependabot.json | 4 +- .../vendor/github-workflows.json | 7 +- .../builtin_schemas/vendor/gitlab-ci.json | 340 +++++++++++++++--- .../builtin_schemas/vendor/mergify.json | 17 +- .../builtin_schemas/vendor/renovate.json | 13 +- .../vendor/sha256/circle-ci.sha256 | 2 +- .../vendor/sha256/compose-spec.sha256 | 2 +- .../vendor/sha256/dependabot.sha256 | 2 +- .../vendor/sha256/github-workflows.sha256 | 2 +- .../vendor/sha256/gitlab-ci.sha256 | 2 +- .../vendor/sha256/mergify.sha256 | 2 +- .../vendor/sha256/renovate.sha256 | 2 +- .../vendor/sha256/taskfile.sha256 | 2 +- .../builtin_schemas/vendor/taskfile.json | 2 +- 17 files changed, 345 insertions(+), 114 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e620e5456..9b8dce2b7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,9 @@ Unreleased .. vendor-insert-here +- Update vendored schemas: circle-ci, compose-spec, dependabot, github-workflows, + gitlab-ci, mergify, renovate, taskfile (2025-03-23) + - Add Meltano schema and pre-commit hook (:issue:`540`). 0.31.3 diff --git a/src/check_jsonschema/builtin_schemas/vendor/circle-ci.json b/src/check_jsonschema/builtin_schemas/vendor/circle-ci.json index 01e68da80..7c2f1bfa5 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/circle-ci.json +++ b/src/check_jsonschema/builtin_schemas/vendor/circle-ci.json @@ -1501,7 +1501,7 @@ "additionalProperties": false, "properties": { "schedule": { - "description": "A workflow may have a schedule indicating it runs at a certain time, for example a nightly build that runs every day at 12am UTC:", + "description": "A workflow may have a schedule indicating it runs at a certain time, for example a nightly build that runs every day at 12am UTC", "type": "object", "properties": { "cron": { diff --git a/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json b/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json index bfaa72dbc..4b6df9a8a 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json +++ b/src/check_jsonschema/builtin_schemas/vendor/compose-spec.json @@ -1,6 +1,6 @@ { - "$schema": "https://json-schema.org/draft/2019-09/schema#", - "id": "compose_spec.json", + "$schema": "https://json-schema.org/draft-07/schema", + "$id": "compose_spec.json", "type": "object", "title": "Compose Specification", "description": "The Compose file is a YAML file defining a multi-containers based application.", @@ -25,7 +25,6 @@ }, "services": { - "id": "#/properties/services", "type": "object", "patternProperties": { "^[a-zA-Z0-9._-]+$": { @@ -36,7 +35,6 @@ }, "networks": { - "id": "#/properties/networks", "type": "object", "patternProperties": { "^[a-zA-Z0-9._-]+$": { @@ -46,7 +44,6 @@ }, "volumes": { - "id": "#/properties/volumes", "type": "object", "patternProperties": { "^[a-zA-Z0-9._-]+$": { @@ -57,7 +54,6 @@ }, "secrets": { - "id": "#/properties/secrets", "type": "object", "patternProperties": { "^[a-zA-Z0-9._-]+$": { @@ -68,7 +64,6 @@ }, "configs": { - "id": "#/properties/configs", "type": "object", "patternProperties": { "^[a-zA-Z0-9._-]+$": { @@ -85,7 +80,6 @@ "definitions": { "service": { - "id": "#/definitions/service", "type": "object", "properties": { @@ -246,8 +240,7 @@ "expose": { "type": "array", "items": { - "type": ["string", "number"], - "format": "expose" + "type": ["string", "number"] }, "uniqueItems": true }, @@ -327,7 +320,8 @@ "^.+$": {"type": ["string", "number"]} } }, - "priority": {"type": "number"} + "priority": {"type": "number"}, + "gw_priority": {"type": "number"} }, "additionalProperties": false, "patternProperties": {"^x-": {}} @@ -376,9 +370,10 @@ "pre_stop": {"type": "array", "items": {"$ref": "#/definitions/service_hook"}}, "privileged": {"type": ["boolean", "string"]}, "profiles": {"$ref": "#/definitions/list_of_strings"}, - "pull_policy": {"type": "string", "enum": [ - "always", "never", "if_not_present", "build", "missing" - ]}, + "pull_policy": {"type": "string", + "pattern": "always|never|build|if_not_present|missing|refresh|daily|weekly|every_([0-9]+[wdhms])+" + }, + "pull_refresh_after": {"type": "string"}, "read_only": {"type": ["boolean", "string"]}, "restart": {"type": "string"}, "runtime": { @@ -469,7 +464,6 @@ }, "healthcheck": { - "id": "#/definitions/healthcheck", "type": "object", "properties": { "disable": {"type": ["boolean", "string"]}, @@ -489,7 +483,6 @@ "patternProperties": {"^x-": {}} }, "development": { - "id": "#/definitions/development", "type": ["object", "null"], "properties": { "watch": { @@ -498,7 +491,8 @@ "type": "object", "required": ["path", "action"], "properties": { - "ignore": {"type": "array", "items": {"type": "string"}}, + "ignore": {"$ref": "#/definitions/string_or_list"}, + "include": {"$ref": "#/definitions/string_or_list"}, "path": {"type": "string"}, "action": {"type": "string", "enum": ["rebuild", "sync", "restart", "sync+restart", "sync+exec"]}, "target": {"type": "string"}, @@ -513,7 +507,6 @@ "patternProperties": {"^x-": {}} }, "deployment": { - "id": "#/definitions/deployment", "type": ["object", "null"], "properties": { "mode": {"type": "string"}, @@ -615,7 +608,6 @@ }, "generic_resources": { - "id": "#/definitions/generic_resources", "type": "array", "items": { "type": "object", @@ -636,7 +628,6 @@ }, "devices": { - "id": "#/definitions/devices", "type": "array", "items": { "type": "object", @@ -656,7 +647,6 @@ }, "gpus": { - "id": "#/definitions/gpus", "oneOf": [ {"type": "string", "enum": ["all"]}, {"type": "array", @@ -677,7 +667,6 @@ }, "include": { - "id": "#/definitions/include", "oneOf": [ {"type": "string"}, { @@ -693,7 +682,6 @@ }, "network": { - "id": "#/definitions/network", "type": ["object", "null"], "properties": { "name": {"type": "string"}, @@ -757,7 +745,6 @@ }, "volume": { - "id": "#/definitions/volume", "type": ["object", "null"], "properties": { "name": {"type": "string"}, @@ -786,7 +773,6 @@ }, "secret": { - "id": "#/definitions/secret", "type": "object", "properties": { "name": {"type": "string"}, @@ -813,7 +799,6 @@ }, "config": { - "id": "#/definitions/config", "type": "object", "properties": { "name": {"type": "string"}, @@ -845,7 +830,6 @@ }, "service_hook": { - "id": "#/definitions/service_hook", "type": "object", "properties": { "command": {"$ref": "#/definitions/command"}, @@ -855,7 +839,8 @@ "environment": {"$ref": "#/definitions/list_or_dict"} }, "additionalProperties": false, - "patternProperties": {"^x-": {}} + "patternProperties": {"^x-": {}}, + "required": ["command"] }, "env_file": { @@ -1010,20 +995,6 @@ ] } } - }, - "constraints": { - "service": { - "id": "#/definitions/constraints/service", - "anyOf": [ - {"required": ["build"]}, - {"required": ["image"]} - ], - "properties": { - "build": { - "required": ["context"] - } - } - } } } } \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/dependabot.json b/src/check_jsonschema/builtin_schemas/vendor/dependabot.json index 8a108d0e3..eba05f82f 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/dependabot.json +++ b/src/check_jsonschema/builtin_schemas/vendor/dependabot.json @@ -653,6 +653,7 @@ "composer", "devcontainers", "docker", + "docker-compose", "dotnet-sdk", "elm", "gitsubmodule", @@ -666,7 +667,8 @@ "pip", "pub", "swift", - "terraform" + "terraform", + "uv" ] }, "schedule-day": { diff --git a/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json b/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json index d1dbfe1fe..e7f449fc2 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json +++ b/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json @@ -109,8 +109,7 @@ "description": "Sets an array of volumes for the container to use. You can use volumes to share data between services or other steps in a job. You can specify named Docker volumes, anonymous Docker volumes, or bind mounts on the host.\nTo specify a volume, you specify the source and destination path: :\nThe is a volume name or an absolute path on the host machine, and is an absolute path in the container.", "type": "array", "items": { - "type": "string", - "pattern": "^[^:]+:[^:]+$" + "type": "string" }, "minItems": 1 }, @@ -1531,10 +1530,6 @@ "description": "A string description of the input parameter.", "type": "string" }, - "deprecationMessage": { - "description": "A string shown to users using the deprecated input.", - "type": "string" - }, "required": { "$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/metadata-syntax-for-github-actions#inputsinput_idrequired", "description": "A boolean to indicate whether the action requires the input parameter. Set to true when the parameter is required.", diff --git a/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json b/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json index 481f52212..5a71408b1 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json +++ b/src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json @@ -8,6 +8,16 @@ "type": "string", "format": "uri" }, + "spec": { + "type": "object", + "markdownDescription": "Specification for pipeline configuration. Must be declared at the top of a configuration file, in a header section separated from the rest of the configuration with `---`. [Learn More](https://docs.gitlab.com/ee/ci/yaml/#spec).", + "properties": { + "inputs": { + "$ref": "#/definitions/inputParameters" + } + }, + "additionalProperties": false + }, "image": { "$ref": "#/definitions/image", "markdownDescription": "Defining `image` globally is deprecated. Use [`default`](https://docs.gitlab.com/ee/ci/yaml/#default) instead. [Learn more](https://docs.gitlab.com/ee/ci/yaml/#globally-defined-image-services-cache-before_script-after_script)." @@ -389,6 +399,156 @@ } ] }, + "inputParameters": { + "type": "object", + "markdownDescription": "Define parameters that can be populated in reusable CI/CD configuration files when added to a pipeline. [Learn More](https://docs.gitlab.com/ee/ci/yaml/inputs).", + "patternProperties": { + ".*": { + "markdownDescription": "**Input Configuration**\n\nAvailable properties:\n- `type`: string (default), array, boolean, or number\n- `description`: Human-readable explanation of the parameter (supports Markdown)\n- `options`: List of allowed values\n- `default`: Value to use when not specified (makes input optional)\n- `regex`: Pattern that string values must match", + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "markdownDescription": "Force a specific input type. Defaults to 'string' when not specified. [Learn More](https://docs.gitlab.com/ee/ci/yaml/inputs/#input-types).", + "enum": [ + "array", + "boolean", + "number", + "string" + ], + "default": "string" + }, + "description": { + "type": "string", + "markdownDescription": "Give a description to a specific input. The description does not affect the input, but can help people understand the input details or expected values. Supports markdown.", + "maxLength": 1024 + }, + "options": { + "type": "array", + "markdownDescription": "Specify a list of allowed values for an input.", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "regex": { + "type": "string", + "markdownDescription": "Specify a regular expression that the input must match. Only impacts inputs with a `type` of `string`." + }, + "default": { + "markdownDescription": "Define default values for inputs when not specified. When you specify a default, the inputs are no longer mandatory." + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "enum": [ + "string" + ] + } + } + }, + "then": { + "properties": { + "default": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "number" + ] + } + } + }, + "then": { + "properties": { + "default": { + "type": [ + "number", + "null" + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "boolean" + ] + } + } + }, + "then": { + "properties": { + "default": { + "type": [ + "boolean", + "null" + ] + } + } + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "array" + ] + } + } + }, + "then": { + "properties": { + "default": { + "oneOf": [ + { + "type": "array" + }, + { + "type": "null" + } + ] + } + } + } + } + ], + "additionalProperties": false + }, + { + "type": "null" + } + ] + } + } + }, "include_item": { "oneOf": [ { @@ -1760,8 +1920,59 @@ "default": false }, "inputs": { - "markdownDescription": "Used to pass input values to included templates or components. [Learn More](https://docs.gitlab.com/ee/ci/yaml/inputs.html#set-input-values-when-using-include).", - "type": "object" + "markdownDescription": "Used to pass input values to included templates, components, downstream pipelines, or child pipelines. [Learn More](https://docs.gitlab.com/ee/ci/yaml/inputs.html).", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9_-]+$": { + "description": "Input parameter value that matches parameter names defined in spec:inputs of the included configuration.", + "oneOf": [ + { + "type": "string", + "maxLength": 1024 + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "additionalProperties": true + } + } + ] + } + }, + { + "type": "object", + "additionalProperties": true + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false }, "job": { "allOf": [ @@ -2161,7 +2372,7 @@ "oneOf": [ { "type": "object", - "markdownDescription": "Trigger a multi-project pipeline. [Learn More](https://docs.gitlab.com/ee/ci/pipelines/multi_project_pipelines.html#specify-a-downstream-pipeline-branch).", + "markdownDescription": "Trigger a multi-project pipeline. [Learn More](https://docs.gitlab.com/ci/pipelines/downstream_pipelines/#multi-project-pipelines).", "additionalProperties": false, "properties": { "project": { @@ -2180,6 +2391,9 @@ "depend" ] }, + "inputs": { + "$ref": "#/definitions/inputs" + }, "forward": { "description": "Specify what to forward to the downstream pipeline.", "type": "object", @@ -2209,7 +2423,7 @@ }, { "type": "object", - "description": "Trigger a child pipeline. [Learn More](https://docs.gitlab.com/ee/ci/pipelines/parent_child_pipelines.html).", + "description": "Trigger a child pipeline. [Learn More](https://docs.gitlab.com/ci/pipelines/downstream_pipelines/#parent-child-pipelines).", "additionalProperties": false, "properties": { "include": { @@ -2551,7 +2765,10 @@ "type": "string" }, { - "$ref": "#/definitions/stepReference" + "$ref": "#/definitions/stepGitReference" + }, + { + "$ref": "#/definitions/stepOciReference" } ] } @@ -2560,31 +2777,6 @@ { "description": "Run a sequence of steps.", "oneOf": [ - { - "type": "object", - "additionalProperties": false, - "required": [ - "steps" - ], - "properties": { - "env": { - "$ref": "#/definitions/stepNamedStrings" - }, - "steps": { - "description": "Deprecated. Use `run` instead.", - "type": "array", - "items": { - "$ref": "#/definitions/step" - } - }, - "outputs": { - "$ref": "#/definitions/stepNamedValues" - }, - "delegate": { - "type": "string" - } - } - }, { "type": "object", "additionalProperties": false, @@ -2704,36 +2896,94 @@ }, "additionalProperties": false }, - "stepReference": { + "stepGitReference": { "type": "object", - "description": "Git a reference to a step in a Git repository.", + "description": "GitReference is a reference to a step in a Git repository.", "additionalProperties": false, "required": [ "git" ], "properties": { "git": { - "$ref": "#/definitions/stepGitReference" + "type": "object", + "additionalProperties": false, + "required": [ + "url", + "rev" + ], + "properties": { + "url": { + "type": "string" + }, + "dir": { + "type": "string" + }, + "rev": { + "type": "string" + }, + "file": { + "type": "string" + } + } } } }, - "stepGitReference": { + "stepOciReference": { "type": "object", - "description": "GitReference is a reference to a step in a Git repository containing the full set of configuration options.", + "description": "OCIReference is a reference to a step hosted in an OCI repository.", "additionalProperties": false, "required": [ - "url", - "rev" + "oci" ], "properties": { - "url": { - "type": "string" - }, - "dir": { - "type": "string" - }, - "rev": { - "type": "string" + "oci": { + "type": "object", + "additionalProperties": false, + "required": [ + "registry", + "repository", + "tag" + ], + "properties": { + "registry": { + "type": "string", + "description": "The [:] of the container registry server.", + "examples": [ + "registry.gitlab.com" + ] + }, + "repository": { + "type": "string", + "description": "A path within the registry containing related OCI images. Typically the namespace, project, and image name.", + "examples": [ + "my_group/my_project/image" + ] + }, + "tag": { + "type": "string", + "description": "A pointer to the image manifest hosted in the OCI repository.", + "examples": [ + "latest", + "1", + "1.5", + "1.5.0" + ] + }, + "dir": { + "type": "string", + "description": "A directory inside the OCI image where the step can be found.", + "examples": [ + "/my_steps/hello_world" + ] + }, + "file": { + "type": "string", + "description": "The name of the file that defines the step, defaults to step.yml.", + "examples": [ + "step.yml" + ] + } + } } } }, diff --git a/src/check_jsonschema/builtin_schemas/vendor/mergify.json b/src/check_jsonschema/builtin_schemas/vendor/mergify.json index 42f9a3337..fb873601e 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/mergify.json +++ b/src/check_jsonschema/builtin_schemas/vendor/mergify.json @@ -1693,7 +1693,6 @@ "CHECKS_FAILED", "QUEUE_RULE_MISSING", "UNEXPECTED_QUEUE_CHANGE", - "PR_FROZEN_NO_CASCADING", "BASE_BRANCH_MISSING", "BASE_BRANCH_CHANGED", "PR_UNEXPECTEDLY_FAILED_TO_MERGE", @@ -2344,8 +2343,8 @@ "anyOf": [ { "enum": [ - "rebase", - "merge" + "merge", + "rebase" ], "type": "string" }, @@ -2562,7 +2561,7 @@ "title": "Merge Method" }, "autosquash": { - "default": true, + "default": false, "description": "This option is relevant only if you do in place checks and if you use the `rebase` option of the update_method. It will automatically squash your commits beginning by `squash!`, `fixup!` or `amend!`, just like the option with the same name when doing a `git rebase`.", "title": "Autosquash", "type": "boolean" @@ -2571,8 +2570,8 @@ "anyOf": [ { "enum": [ - "rebase", - "merge" + "merge", + "rebase" ], "type": "string" }, @@ -2799,7 +2798,7 @@ "title": "Merge Method" }, "autosquash": { - "default": true, + "default": false, "description": "This option is relevant only if you do in place checks and if you use the `rebase` option of the update_method. It will automatically squash your commits beginning by `squash!`, `fixup!` or `amend!`, just like the option with the same name when doing a `git rebase`.", "title": "Autosquash", "type": "boolean" @@ -2808,8 +2807,8 @@ "anyOf": [ { "enum": [ - "rebase", - "merge" + "merge", + "rebase" ], "type": "string" }, diff --git a/src/check_jsonschema/builtin_schemas/vendor/renovate.json b/src/check_jsonschema/builtin_schemas/vendor/renovate.json index 01a73e5d7..11b57c690 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/renovate.json +++ b/src/check_jsonschema/builtin_schemas/vendor/renovate.json @@ -1091,7 +1091,7 @@ "dockerSidecarImage": { "description": "Change this value to override the default Renovate sidecar image.", "type": "string", - "default": "ghcr.io/containerbase/sidecar:13.8.4" + "default": "ghcr.io/containerbase/sidecar:13.8.5" }, "dockerUser": { "description": "Set the `UID` and `GID` for Docker-based binaries if you use `binarySource=docker`.", @@ -2774,6 +2774,17 @@ }, "$ref": "#" }, + "pixi": { + "description": "Configuration object for the pixi manager", + "type": "object", + "default": { + "fileMatch": [ + "(^|/)pyproject\\.toml$", + "(^|/)pixi\\.toml$" + ] + }, + "$ref": "#" + }, "platform": { "description": "Platform type of repository.", "type": "string", diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/circle-ci.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/circle-ci.sha256 index 32be41c77..17444d1c7 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/circle-ci.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/circle-ci.sha256 @@ -1 +1 @@ -07533ac8ed37edd4ee71bc39daecd03c5ee88619732e7dc24cf7627a272d9cd1 \ No newline at end of file +21743cc33a819684da3c501c2d22c94ff02b520f055b1610356c86e9acd06847 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 index d2752d3d3..d4980ac08 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/compose-spec.sha256 @@ -1 +1 @@ -91ae91d24640d45634c9d4b5f4e3a5ce1b6b6da38bc06b27e2a04891f81f32da \ No newline at end of file +ea8f3bd1e32cb93be231122144b119746b68b18d79ed118704c6fa3aa105a49e \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/dependabot.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/dependabot.sha256 index 647cb5503..92886561a 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/dependabot.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/dependabot.sha256 @@ -1 +1 @@ -c3463cad77fbd8f9e520c140b8bd337ff6c52190b9079e4661f4cf548ebf44b4 \ No newline at end of file +cb463f9339bdd74292186de0b64876d8a033a491b76c2f0355b7bbee2f8cfda3 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 index ab9433a9c..946206422 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 @@ -1 +1 @@ -287c4e34b14a32340166605a8b98846409f9177234d1f308263834a31b7692e7 \ No newline at end of file +078574bb83ad5dea5fec202acd20a7624e3d93a0f194ddb5bb3cf45d4593af37 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 index 37f872873..a2e5344f2 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/gitlab-ci.sha256 @@ -1 +1 @@ -7570c1d2b90e172fdcc05906939e70aeb34c12e5c9ebc24f10600c68641762a5 \ No newline at end of file +97c097a9307c49b1db177bc7d94979d4e30d6ff91705f5de33c31cd38f375746 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 index 431745e84..b451e7747 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/mergify.sha256 @@ -1 +1 @@ -fdab26935842c3462745512106824a5aca147f86d15b7accc9e49c81dbc4bc5a \ No newline at end of file +0c2f20fa607c47b0c3c8e0f9162fc7177bcc70b4e720d061e53e492da8d411b8 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 index f0cca0b40..782760a15 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 @@ -1 +1 @@ -6cd4ba56fbd2a370764ad0dda37fcdd0dee0f6d7fd08674b2c50f4c103fb38f9 \ No newline at end of file +ff0fd999097a822ef76fb9d6b7407815ed57d189ed820e962ec6ad7937784bf2 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/taskfile.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/taskfile.sha256 index 31e0bca03..5b823abbd 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/taskfile.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/taskfile.sha256 @@ -1 +1 @@ -4ed69fa81667b77ee5e0146080dd73b376ee88ea5dd23e743644a495c7f35c80 \ No newline at end of file +b40df180ca88093a8be667dd996b43221de2ad6d85c48f78e5f43784d29dc9a9 \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/taskfile.json b/src/check_jsonschema/builtin_schemas/vendor/taskfile.json index a44df7a8d..49af497b4 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/taskfile.json +++ b/src/check_jsonschema/builtin_schemas/vendor/taskfile.json @@ -733,7 +733,7 @@ "$ref": "#/definitions/run" }, "interval": { - "description": "Sets a different watch interval when using `--watch`, the default being 5 seconds. This string should be a valid Go duration: https://pkg.go.dev/time#ParseDuration.", + "description": "Sets a different watch interval when using `--watch`, the default being 100 milliseconds. This string should be a valid Go duration: https://pkg.go.dev/time#ParseDuration.", "type": "string", "pattern": "^[0-9]+(?:m|s|ms)$" } From ce806fb2f69631b7b4c12dbd22e429910662f4c9 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Tue, 25 Mar 2025 19:51:11 -0500 Subject: [PATCH 25/29] Update Snapcraft catalog entry Also fix an EOF. --- .pre-commit-hooks.yaml | 7 ++----- docs/precommit_usage.rst | 2 +- src/check_jsonschema/catalog.py | 5 ++++- .../example-files/hooks/positive/snapcraft/snapcraft.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 3d8009e67..8d9e89760 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -211,13 +211,10 @@ # and run `make generate-hooks` or `tox run -e generate-hooks-config` - id: check-snapcraft name: Validate snapcraft files - description: 'Validate snapcraft files against the schema provided by SchemaStore' + description: 'Validate snapcraft files against the schema provided by Canonical' entry: check-jsonschema --builtin-schema vendor.snapcraft language: python - files: > - (?x)^( - ([^/]*/)*snapcraft.yaml - )$ + files: ^(.+/)?snapcraft\.yaml$ types: [yaml] # this hook is autogenerated from a script diff --git a/docs/precommit_usage.rst b/docs/precommit_usage.rst index 9a2005c14..db147ec45 100644 --- a/docs/precommit_usage.rst +++ b/docs/precommit_usage.rst @@ -256,7 +256,7 @@ Validate Renovate config against the schema provided by Renovate (does not suppo ``check-snapcraft`` ~~~~~~~~~~~~~~~~~~~ -Validate snapcraft files against the schema provided by SchemaStore +Validate snapcraft files against the schema provided by Canonical .. code-block:: yaml :caption: example config diff --git a/src/check_jsonschema/catalog.py b/src/check_jsonschema/catalog.py index 4c2972bc4..0b34ef1f0 100644 --- a/src/check_jsonschema/catalog.py +++ b/src/check_jsonschema/catalog.py @@ -218,7 +218,10 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: ), "hook_config": { "name": "Validate snapcraft files", - "files": [r"([^/]*/)*snapcraft.yaml"], + "description": ( + "Validate snapcraft files against the schema provided by Canonical" + ), + "files": r"^(.+/)?snapcraft\.yaml$", "types": "yaml", }, }, diff --git a/tests/example-files/hooks/positive/snapcraft/snapcraft.yaml b/tests/example-files/hooks/positive/snapcraft/snapcraft.yaml index 9258e2e7d..282308a77 100644 --- a/tests/example-files/hooks/positive/snapcraft/snapcraft.yaml +++ b/tests/example-files/hooks/positive/snapcraft/snapcraft.yaml @@ -12,4 +12,4 @@ apps: parts: gnu-hello: source: http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz - plugin: autotools \ No newline at end of file + plugin: autotools From 4dea31e4e40cca0346dbedf5702829f342138def Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Tue, 25 Mar 2025 20:25:32 -0500 Subject: [PATCH 26/29] Update vendored schemas --- CHANGELOG.rst | 2 +- .../builtin_schemas/vendor/github-workflows.json | 5 ++++- src/check_jsonschema/builtin_schemas/vendor/renovate.json | 3 ++- .../builtin_schemas/vendor/sha256/github-workflows.sha256 | 2 +- .../builtin_schemas/vendor/sha256/renovate.sha256 | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9b8dce2b7..3b8f5fa6b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,7 +11,7 @@ Unreleased .. vendor-insert-here - Update vendored schemas: circle-ci, compose-spec, dependabot, github-workflows, - gitlab-ci, mergify, renovate, taskfile (2025-03-23) + gitlab-ci, mergify, renovate, taskfile (2025-03-25) - Add Meltano schema and pre-commit hook (:issue:`540`). diff --git a/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json b/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json index e7f449fc2..e1c0b890f 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json +++ b/src/check_jsonschema/builtin_schemas/vendor/github-workflows.json @@ -680,7 +680,10 @@ "type": "string" } ], - "minItems": 1 + "minItems": 1, + "additionalItems": { + "type": "string" + } } ] }, diff --git a/src/check_jsonschema/builtin_schemas/vendor/renovate.json b/src/check_jsonschema/builtin_schemas/vendor/renovate.json index 11b57c690..08ee46d44 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/renovate.json +++ b/src/check_jsonschema/builtin_schemas/vendor/renovate.json @@ -1091,7 +1091,7 @@ "dockerSidecarImage": { "description": "Change this value to override the default Renovate sidecar image.", "type": "string", - "default": "ghcr.io/containerbase/sidecar:13.8.5" + "default": "ghcr.io/containerbase/sidecar:13.8.8" }, "dockerUser": { "description": "Set the `UID` and `GID` for Docker-based binaries if you use `binarySource=docker`.", @@ -3699,6 +3699,7 @@ "cargo", "composer", "conan", + "conda", "deb", "debian", "devbox", diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 index 946206422..7c5776874 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/github-workflows.sha256 @@ -1 +1 @@ -078574bb83ad5dea5fec202acd20a7624e3d93a0f194ddb5bb3cf45d4593af37 \ No newline at end of file +e2fe2167fb07a4121a234523058195afd42792fdf3d06ca3c731d91ff55a8a8c \ No newline at end of file diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 index 782760a15..384f25b3c 100644 --- a/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/renovate.sha256 @@ -1 +1 @@ -ff0fd999097a822ef76fb9d6b7407815ed57d189ed820e962ec6ad7937784bf2 \ No newline at end of file +30ab380b17083e659ff9e7e5ff8d770e89b2d5889fdb526407a9a4a807dedefc \ No newline at end of file From a75a8a04aaab916e9c8409fdf27fe454fe48cae1 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Tue, 25 Mar 2025 20:28:57 -0500 Subject: [PATCH 27/29] Bump version for release --- CHANGELOG.rst | 7 ++++-- README.md | 2 +- docs/optional_parsers.rst | 4 ++-- docs/precommit_usage.rst | 48 +++++++++++++++++++-------------------- pyproject.toml | 2 +- 5 files changed, 33 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3b8f5fa6b..921d671c2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,10 +10,13 @@ Unreleased .. vendor-insert-here +0.32.0 +------ + - Update vendored schemas: circle-ci, compose-spec, dependabot, github-workflows, gitlab-ci, mergify, renovate, taskfile (2025-03-25) - -- Add Meltano schema and pre-commit hook (:issue:`540`). +- Add Meltano schema and pre-commit hook. Thanks :user:`edgarrmondragon`! (:issue:`540`) +- Add Snapcraft schema and pre-commit hook. Thanks :user:`fabolhak`! (:issue:`535`) 0.31.3 ------ diff --git a/README.md b/README.md index 98754e8a7..bebf12b24 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ files. ```yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-github-workflows args: ["--verbose"] diff --git a/docs/optional_parsers.rst b/docs/optional_parsers.rst index 8f8610c59..ca8c8a7bf 100644 --- a/docs/optional_parsers.rst +++ b/docs/optional_parsers.rst @@ -20,7 +20,7 @@ For example, .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-renovate additional_dependencies: ['pyjson5'] @@ -45,7 +45,7 @@ For example, .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-jsonschema name: 'Check GitHub Workflows' diff --git a/docs/precommit_usage.rst b/docs/precommit_usage.rst index a975506c8..0aaf42850 100644 --- a/docs/precommit_usage.rst +++ b/docs/precommit_usage.rst @@ -17,7 +17,7 @@ You must specify a schema using pre-commit ``args`` configuration. :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-jsonschema files: ^data/.*\.json$ @@ -34,7 +34,7 @@ Validate JSON Schema files against their matching metaschema, as specified in th :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-metaschema files: ^schemas/.*\.json$ @@ -52,7 +52,7 @@ Validate Azure Pipelines config against the schema provided by Microsoft :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-azure-pipelines @@ -66,7 +66,7 @@ Validate Bamboo Specs against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-bamboo-spec @@ -80,7 +80,7 @@ Validate Bitbucket Pipelines against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-bitbucket-pipelines @@ -94,7 +94,7 @@ Validate Buildkite Pipelines against the schema provided by Buildkite :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-buildkite @@ -108,7 +108,7 @@ Validate CircleCI config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-circle-ci @@ -122,7 +122,7 @@ Validate Google Cloud Build config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-cloudbuild @@ -136,7 +136,7 @@ Validate Docker Compose files against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-compose-spec @@ -150,7 +150,7 @@ Validate Dependabot Config (v2) against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-dependabot @@ -164,7 +164,7 @@ Validate Drone-CI Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-drone-ci @@ -178,7 +178,7 @@ Validate GitHub Actions against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-github-actions @@ -192,7 +192,7 @@ Validate GitHub Workflows against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-github-workflows @@ -206,7 +206,7 @@ Validate GitLab CI config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-gitlab-ci @@ -220,7 +220,7 @@ Validate Meltano config against the schema provided by Meltano :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-meltano @@ -234,7 +234,7 @@ Validate Mergify config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-mergify @@ -248,7 +248,7 @@ Validate ReadTheDocs config against the schema provided by ReadTheDocs :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-readthedocs @@ -262,7 +262,7 @@ Validate Renovate config against the schema provided by Renovate (does not suppo :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-renovate @@ -276,7 +276,7 @@ Validate snapcraft files against the schema provided by Canonical :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-snapcraft @@ -290,7 +290,7 @@ Validate Taskfile config against the schema provided by Task :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-taskfile @@ -304,7 +304,7 @@ Validate Travis Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-travis @@ -318,7 +318,7 @@ Validate Woodpecker Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-woodpecker-ci @@ -344,7 +344,7 @@ manually, you could do this: .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-jsonschema name: "Check GitHub Workflows" @@ -363,7 +363,7 @@ To check with the builtin schema that a GitHub workflow sets .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.32.0 hooks: - id: check-jsonschema name: "Check GitHub Workflows set timeout-minutes" diff --git a/pyproject.toml b/pyproject.toml index a6bbf7bd7..69f2a9ba5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "check-jsonschema" -version = "0.31.3" +version = "0.32.0" description = "A jsonschema CLI and pre-commit hook" authors = [ { name = "Stephen Rosen", email = "sirosen0@gmail.com" }, From 365a32e0c107e9efeaadb1eea9502cf790ba0214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Tue, 25 Mar 2025 20:04:15 -0600 Subject: [PATCH 28/29] Use `types_or` for the `check-meltano` hook --- .pre-commit-hooks.yaml | 2 +- src/check_jsonschema/catalog.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index ef11b317e..80da2c0c6 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -177,7 +177,7 @@ meltano-manifest\.json| meltano-manifest\..+\.json )$ - types: [json,yaml] + types_or: [json,yaml] # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` diff --git a/src/check_jsonschema/catalog.py b/src/check_jsonschema/catalog.py index 4111a62c3..cc7f1587e 100644 --- a/src/check_jsonschema/catalog.py +++ b/src/check_jsonschema/catalog.py @@ -183,7 +183,7 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: r"meltano-manifest\.json", r"meltano-manifest\..+\.json", ], - "types": ["json", "yaml"], + "types_or": ["json", "yaml"], }, }, "mergify": { From b6230f5861248507c2f7d7fc002ce66bd8dfa742 Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Tue, 25 Mar 2025 21:15:49 -0500 Subject: [PATCH 29/29] Bump version for release --- CHANGELOG.rst | 6 +++++ README.md | 2 +- docs/optional_parsers.rst | 4 ++-- docs/precommit_usage.rst | 48 +++++++++++++++++++-------------------- pyproject.toml | 2 +- 5 files changed, 34 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 921d671c2..b1d0a1bc1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,12 @@ Unreleased .. vendor-insert-here +0.32.1 +------ + +- Fix the ``check-meltano`` hook to use ``types_or``. Thanks + :user:`edgarrmondragon`! (:pr:`543`) + 0.32.0 ------ diff --git a/README.md b/README.md index bebf12b24..eeda17ea5 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ files. ```yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-github-workflows args: ["--verbose"] diff --git a/docs/optional_parsers.rst b/docs/optional_parsers.rst index ca8c8a7bf..8d433e297 100644 --- a/docs/optional_parsers.rst +++ b/docs/optional_parsers.rst @@ -20,7 +20,7 @@ For example, .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-renovate additional_dependencies: ['pyjson5'] @@ -45,7 +45,7 @@ For example, .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-jsonschema name: 'Check GitHub Workflows' diff --git a/docs/precommit_usage.rst b/docs/precommit_usage.rst index 0aaf42850..22f3e4b15 100644 --- a/docs/precommit_usage.rst +++ b/docs/precommit_usage.rst @@ -17,7 +17,7 @@ You must specify a schema using pre-commit ``args`` configuration. :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-jsonschema files: ^data/.*\.json$ @@ -34,7 +34,7 @@ Validate JSON Schema files against their matching metaschema, as specified in th :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-metaschema files: ^schemas/.*\.json$ @@ -52,7 +52,7 @@ Validate Azure Pipelines config against the schema provided by Microsoft :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-azure-pipelines @@ -66,7 +66,7 @@ Validate Bamboo Specs against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-bamboo-spec @@ -80,7 +80,7 @@ Validate Bitbucket Pipelines against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-bitbucket-pipelines @@ -94,7 +94,7 @@ Validate Buildkite Pipelines against the schema provided by Buildkite :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-buildkite @@ -108,7 +108,7 @@ Validate CircleCI config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-circle-ci @@ -122,7 +122,7 @@ Validate Google Cloud Build config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-cloudbuild @@ -136,7 +136,7 @@ Validate Docker Compose files against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-compose-spec @@ -150,7 +150,7 @@ Validate Dependabot Config (v2) against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-dependabot @@ -164,7 +164,7 @@ Validate Drone-CI Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-drone-ci @@ -178,7 +178,7 @@ Validate GitHub Actions against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-github-actions @@ -192,7 +192,7 @@ Validate GitHub Workflows against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-github-workflows @@ -206,7 +206,7 @@ Validate GitLab CI config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-gitlab-ci @@ -220,7 +220,7 @@ Validate Meltano config against the schema provided by Meltano :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-meltano @@ -234,7 +234,7 @@ Validate Mergify config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-mergify @@ -248,7 +248,7 @@ Validate ReadTheDocs config against the schema provided by ReadTheDocs :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-readthedocs @@ -262,7 +262,7 @@ Validate Renovate config against the schema provided by Renovate (does not suppo :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-renovate @@ -276,7 +276,7 @@ Validate snapcraft files against the schema provided by Canonical :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-snapcraft @@ -290,7 +290,7 @@ Validate Taskfile config against the schema provided by Task :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-taskfile @@ -304,7 +304,7 @@ Validate Travis Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-travis @@ -318,7 +318,7 @@ Validate Woodpecker Config against the schema provided by SchemaStore :caption: example config - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-woodpecker-ci @@ -344,7 +344,7 @@ manually, you could do this: .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-jsonschema name: "Check GitHub Workflows" @@ -363,7 +363,7 @@ To check with the builtin schema that a GitHub workflow sets .. code-block:: yaml - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.32.0 + rev: 0.32.1 hooks: - id: check-jsonschema name: "Check GitHub Workflows set timeout-minutes" diff --git a/pyproject.toml b/pyproject.toml index 69f2a9ba5..85ba2a611 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "check-jsonschema" -version = "0.32.0" +version = "0.32.1" description = "A jsonschema CLI and pre-commit hook" authors = [ { name = "Stephen Rosen", email = "sirosen0@gmail.com" },