Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ repos:
hooks:
- id: flake8
additional_dependencies:
- 'flake8-bugbear==24.12.12'
- 'flake8-typing-as-t==1.0.0'
- 'flake8-comprehensions==3.16.0'
- 'flake8-bugbear==25.11.29'
- 'flake8-typing-as-t==1.1.0'
- 'flake8-comprehensions==3.17.0'
- repo: https://github.com/sirosen/slyp
rev: 0.8.2
hooks:
Expand Down
1 change: 1 addition & 0 deletions src/check_jsonschema/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

class _Exit(Exception):
def __init__(self, code: int) -> None:
super().__init__(code)
self.code = code


Expand Down
12 changes: 5 additions & 7 deletions src/check_jsonschema/transforms/gitlab.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
from __future__ import annotations

import typing as t

import ruamel.yaml

from .base import Transform


class GitLabReferenceExpectationViolation(ValueError):
def __init__(self, msg: str, data: t.Any) -> None:
super().__init__(
f"check-jsonschema rejects this gitlab !reference tag: {msg}\n{data!r}"
)
pass


class GitLabReference:
Expand All @@ -22,7 +17,10 @@ def from_yaml(
cls, constructor: ruamel.yaml.BaseConstructor, node: ruamel.yaml.Node
) -> list[str]:
if not isinstance(node.value, list):
raise GitLabReferenceExpectationViolation("non-list value", node)
raise GitLabReferenceExpectationViolation(
"check-jsonschema rejects this gitlab !reference tag: "
f"non-list-value\n{node!r}"
)
return [item.value for item in node.value]


Expand Down
Loading