Skip to content

Commit 8596b99

Browse files
authored
Update flake8 plugins & fix lint failures (#649)
- Update with `upadup` - Run `pre-commit run -a` - Fix the failures on B042 for exceptions which don't play well with copy
1 parent 7018159 commit 8596b99

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ repos:
3232
hooks:
3333
- id: flake8
3434
additional_dependencies:
35-
- 'flake8-bugbear==24.12.12'
36-
- 'flake8-typing-as-t==1.0.0'
37-
- 'flake8-comprehensions==3.16.0'
35+
- 'flake8-bugbear==25.11.29'
36+
- 'flake8-typing-as-t==1.1.0'
37+
- 'flake8-comprehensions==3.17.0'
3838
- repo: https://github.com/sirosen/slyp
3939
rev: 0.8.2
4040
hooks:

src/check_jsonschema/checker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
class _Exit(Exception):
2121
def __init__(self, code: int) -> None:
22+
super().__init__(code)
2223
self.code = code
2324

2425

src/check_jsonschema/transforms/gitlab.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
from __future__ import annotations
22

3-
import typing as t
4-
53
import ruamel.yaml
64

75
from .base import Transform
86

97

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

1611

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

2826

0 commit comments

Comments
 (0)