Skip to content

Commit 01e8782

Browse files
committed
Update vendored schemas and pre-commit config
Due to a flake8-bugbear update, also tweak some usages to pass linting.
1 parent ce16584 commit 01e8782

File tree

8 files changed

+66
-85
lines changed

8 files changed

+66
-85
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
# dogfood
33
- repo: https://github.com/python-jsonschema/check-jsonschema
4-
rev: 0.24.1
4+
rev: 0.26.0
55
hooks:
66
- id: check-dependabot
77
- id: check-github-workflows
@@ -26,7 +26,7 @@ repos:
2626
rev: 6.1.0
2727
hooks:
2828
- id: flake8
29-
additional_dependencies: ['flake8-bugbear==22.7.1']
29+
additional_dependencies: ['flake8-bugbear==23.7.10']
3030
- repo: https://github.com/PyCQA/isort
3131
rev: 5.12.0
3232
hooks:

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Unreleased
1010

1111
.. vendor-insert-here
1212
13+
- Update vendored schemas: github-workflows, renovate (2023-08-25)
14+
1315
0.26.0
1416
------
1517
- The regex format check has been improved to support ECMAScript regexes by

src/check_jsonschema/builtin_schemas/vendor/github-workflows.json

Lines changed: 49 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,53 @@
419419
}
420420
]
421421
},
422+
"matrix": {
423+
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix",
424+
"description": "A build matrix is a set of different configurations of the virtual environment. For example you might run a job against more than one supported version of a language, operating system, or tool. Each configuration is a copy of the job that runs and reports a status.\nYou can specify a matrix by supplying an array for the configuration options. For example, if the GitHub virtual environment supports Node.js versions 6, 8, and 10 you could specify an array of those versions in the matrix.\nWhen you define a matrix of operating systems, you must set the required runs-on keyword to the operating system of the current job, rather than hard-coding the operating system name. To access the operating system name, you can use the matrix.os context parameter to set runs-on. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.",
425+
"oneOf": [
426+
{
427+
"type": "object"
428+
},
429+
{
430+
"$ref": "#/definitions/expressionSyntax"
431+
}
432+
],
433+
"patternProperties": {
434+
"^(in|ex)clude$": {
435+
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build",
436+
"oneOf": [
437+
{
438+
"$ref": "#/definitions/expressionSyntax"
439+
},
440+
{
441+
"type": "array",
442+
"items": {
443+
"type": "object",
444+
"additionalProperties": {
445+
"$ref": "#/definitions/configuration"
446+
}
447+
},
448+
"minItems": 1
449+
}
450+
]
451+
}
452+
},
453+
"additionalProperties": {
454+
"oneOf": [
455+
{
456+
"type": "array",
457+
"items": {
458+
"$ref": "#/definitions/configuration"
459+
},
460+
"minItems": 1
461+
},
462+
{
463+
"$ref": "#/definitions/expressionSyntax"
464+
}
465+
]
466+
},
467+
"minProperties": 1
468+
},
422469
"reusableWorkflowCallJob": {
423470
"$comment": "https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#calling-a-reusable-workflow",
424471
"description": "Each job must have an id to associate with the job. The key job_id is a string and its value is a map of the job's configuration data. You must replace <job_id> with a string that is unique to the jobs object. The <job_id> must start with a letter or _ and contain only alphanumeric characters, -, or _.",
@@ -470,44 +517,7 @@
470517
"type": "object",
471518
"properties": {
472519
"matrix": {
473-
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix",
474-
"description": "A build matrix is a set of different configurations of the virtual environment. For example you might run a job against more than one supported version of a language, operating system, or tool. Each configuration is a copy of the job that runs and reports a status.\nYou can specify a matrix by supplying an array for the configuration options. For example, if the GitHub virtual environment supports Node.js versions 6, 8, and 10 you could specify an array of those versions in the matrix.\nWhen you define a matrix of operating systems, you must set the required runs-on keyword to the operating system of the current job, rather than hard-coding the operating system name. To access the operating system name, you can use the matrix.os context parameter to set runs-on. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.",
475-
"oneOf": [
476-
{
477-
"type": "object"
478-
},
479-
{
480-
"$ref": "#/definitions/expressionSyntax"
481-
}
482-
],
483-
"patternProperties": {
484-
"^(in|ex)clude$": {
485-
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build",
486-
"type": "array",
487-
"items": {
488-
"type": "object",
489-
"additionalProperties": {
490-
"$ref": "#/definitions/configuration"
491-
}
492-
},
493-
"minItems": 1
494-
}
495-
},
496-
"additionalProperties": {
497-
"oneOf": [
498-
{
499-
"type": "array",
500-
"items": {
501-
"$ref": "#/definitions/configuration"
502-
},
503-
"minItems": 1
504-
},
505-
{
506-
"$ref": "#/definitions/expressionSyntax"
507-
}
508-
]
509-
},
510-
"minProperties": 1
520+
"$ref": "#/definitions/matrix"
511521
},
512522
"fail-fast": {
513523
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast",
@@ -889,44 +899,7 @@
889899
"type": "object",
890900
"properties": {
891901
"matrix": {
892-
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix",
893-
"description": "A build matrix is a set of different configurations of the virtual environment. For example you might run a job against more than one supported version of a language, operating system, or tool. Each configuration is a copy of the job that runs and reports a status.\nYou can specify a matrix by supplying an array for the configuration options. For example, if the GitHub virtual environment supports Node.js versions 6, 8, and 10 you could specify an array of those versions in the matrix.\nWhen you define a matrix of operating systems, you must set the required runs-on keyword to the operating system of the current job, rather than hard-coding the operating system name. To access the operating system name, you can use the matrix.os context parameter to set runs-on. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.",
894-
"oneOf": [
895-
{
896-
"type": "object"
897-
},
898-
{
899-
"$ref": "#/definitions/expressionSyntax"
900-
}
901-
],
902-
"patternProperties": {
903-
"^(in|ex)clude$": {
904-
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build",
905-
"type": "array",
906-
"items": {
907-
"type": "object",
908-
"additionalProperties": {
909-
"$ref": "#/definitions/configuration"
910-
}
911-
},
912-
"minItems": 1
913-
}
914-
},
915-
"additionalProperties": {
916-
"oneOf": [
917-
{
918-
"type": "array",
919-
"items": {
920-
"$ref": "#/definitions/configuration"
921-
},
922-
"minItems": 1
923-
},
924-
{
925-
"$ref": "#/definitions/expressionSyntax"
926-
}
927-
]
928-
},
929-
"minProperties": 1
902+
"$ref": "#/definitions/matrix"
930903
},
931904
"fail-fast": {
932905
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7c009ac488bfd9315bcdb66e2462c13caa8bcb30ad2de7adeb7c05cbc129698c
1+
555a0121150e7241672f6496c568ccc317a06fcf5115ab248a0351aeb1cba65a

src/check_jsonschema/builtin_schemas/vendor/renovate.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@
393393
"type": "integer",
394394
"default": 1440
395395
},
396+
"cacheTtlOverride": {
397+
"description": "An object that contains cache namespace TTL override values",
398+
"type": "object",
399+
"default": {},
400+
"$ref": "#"
401+
},
396402
"cake": {
397403
"description": "Configuration object for the cake manager",
398404
"type": "object",
@@ -768,7 +774,7 @@
768774
"dockerSidecarImage": {
769775
"description": "Change this value to override the default Renovate sidecar image.",
770776
"type": "string",
771-
"default": "ghcr.io/containerbase/sidecar:9.17.3"
777+
"default": "ghcr.io/containerbase/sidecar:9.19.0"
772778
},
773779
"dockerUser": {
774780
"description": "Set the `UID` and `GID` for Docker-based binaries if you use `binarySource=docker`.",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9d5809dff3355cad4972c046c07f42553e154ee8c5f1f72b41dde6aec15eb6b6
1+
f0799b37b14031aa00e8648fafdecbcb4c88c3b90c3925ea230f7badea85b01a

src/check_jsonschema/cli/warnings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def callback(ctx: click.Context, param: click.Parameter, value: t.Any) -> t.Any:
1818
)
1919
if append_message is not None:
2020
message += f" {append_message}"
21-
warnings.warn(message)
21+
warnings.warn(message, stacklevel=2)
2222

2323
return value
2424

tests/unit/test_gitlab_data_transform.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from check_jsonschema.parsers.yaml import construct_yaml_implementation
3+
from check_jsonschema.parsers.yaml import ParseError, construct_yaml_implementation
44
from check_jsonschema.transforms.gitlab import (
55
GITLAB_TRANSFORM,
66
GitLabReferenceExpectationViolation,
@@ -30,7 +30,7 @@ def test_can_parse_ok_gitlab_yaml_with_transform():
3030
"""
3131
impl = construct_yaml_implementation()
3232

33-
with pytest.raises(Exception):
33+
with pytest.raises(ParseError):
3434
data = impl.load(rawdata)
3535

3636
GITLAB_TRANSFORM.modify_yaml_implementation(impl)
@@ -45,7 +45,7 @@ def test_cannot_parse_bad_gitlab_yaml_with_transform():
4545
"""
4646
impl = construct_yaml_implementation()
4747

48-
with pytest.raises(Exception):
48+
with pytest.raises(ParseError):
4949
impl.load(rawdata)
5050

5151
GITLAB_TRANSFORM.modify_yaml_implementation(impl)

0 commit comments

Comments
 (0)