Skip to content

Commit 02d73b9

Browse files
authored
Updated pre-commit versions (#211)
1 parent 784d25c commit 02d73b9

File tree

4 files changed

+2
-8
lines changed

4 files changed

+2
-8
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
- --autofix
2626
- id: trailing-whitespace
2727
- repo: https://github.com/myint/autoflake
28-
rev: v2.0.0
28+
rev: v2.0.1
2929
hooks:
3030
- id: autoflake
3131
args:
@@ -76,7 +76,7 @@ repos:
7676
- "-lll"
7777
- "tests"
7878
- repo: https://github.com/psf/black
79-
rev: 22.12.0
79+
rev: 23.1.0
8080
hooks:
8181
- id: black
8282
- repo: https://github.com/pre-commit/pygrep-hooks

json_codegen/generators/python3.py

-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ def get_partial_annotation_from_definition(self, property_: PropertyType) -> ast
276276
items = property_.get("items")
277277

278278
if isinstance(items, dict):
279-
280279
item_annotation = self.get_partial_annotation_from_definition(items)
281280
elif isinstance(items, list):
282281
raise NotImplementedError(f"Tuple for 'array' is not supported: {property_}")

json_codegen/generators/python3_marshmallow/generator.py

-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ def _default_helper(el):
147147
raise NotImplementedError("Default type not handled (List)")
148148

149149
def _dict_default_helper(d):
150-
151150
keys = []
152151
values = []
153152

json_codegen/generators/python3_marshmallow/object_generator.py

-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def _hint_required_property(node_assign, value, object_, prop):
7272

7373
@staticmethod
7474
def _get_default_for_property(node_assign, value, object_, prop):
75-
7675
for node in ast.walk(node_assign):
7776
if isinstance(node, ast.keyword) and node.arg == "required":
7877
return value
@@ -159,7 +158,6 @@ def construct_class(schema):
159158

160159
@staticmethod
161160
def _construct_to_(output):
162-
163161
if output == "json":
164162
method = "dumps"
165163
elif output == "dict":
@@ -168,7 +166,6 @@ def _construct_to_(output):
168166
raise NotImplementedError("Only deserialisation to json or dict supported")
169167

170168
def _construct_to_helper(schema):
171-
172169
fn_args = ast.arguments(
173170
args=[ast.arg(arg="self", annotation=None)],
174171
vararg=None,
@@ -210,7 +207,6 @@ def _construct_to_helper(schema):
210207

211208
@staticmethod
212209
def construct_from_json(schema):
213-
214210
fn_args = ast.arguments(
215211
args=[
216212
ast.arg(arg="json", annotation=ast.Name(id="str")),

0 commit comments

Comments
 (0)