Skip to content

Commit 92b5ee1

Browse files
committed
precommit resolution
1 parent 40554fc commit 92b5ee1

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ build-backend = "hatchling.build"
6262
[project.scripts]
6363
hypothesisjson = "hypothesis_jsonschema._cli:app"
6464

65-
[tool.ruff]
65+
[tool.ruff.lint]
6666
select = [
6767
"ASYNC", # flake8-async
6868
"B", # flake8-bugbear
@@ -115,6 +115,7 @@ ignore = [
115115
"PT027",
116116
"UP031",
117117
]
118+
[tool.ruff]
118119
target-version = "py38"
119120

120121

src/hypothesis_jsonschema/_canonicalise.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
)
5252
# Names of keywords where the associated values may be schemas or lists of schemas.
5353
SCHEMA_KEYS = tuple(
54-
"items additionalItems contains additionalProperties propertyNames " "if then else allOf anyOf oneOf not".split()
54+
"items additionalItems contains additionalProperties propertyNames if then else allOf anyOf oneOf not".split()
5555
)
5656
# Names of keywords where the value is an object whose values are schemas.
5757
# Note that in some cases ("dependencies"), the value may be a list of strings.
@@ -253,7 +253,7 @@ def canonicalish(schema: JSONType) -> Dict[str, Any]:
253253

254254
# Otherwise, we're dealing with "objects", i.e. dicts.
255255
if not isinstance(schema, dict):
256-
raise InvalidArgument(f"Got schema={schema!r} of type {type(schema).__name__}, " "but expected a dict.")
256+
raise InvalidArgument(f"Got schema={schema!r} of type {type(schema).__name__}, but expected a dict.")
257257

258258
if "const" in schema:
259259
if not make_validator(schema).is_valid(schema["const"]):
@@ -790,8 +790,8 @@ def has_divisibles(
790790
start: float,
791791
end: float,
792792
divisor: float,
793-
exmin: bool,
794-
exmax: bool, # noqa
793+
exmin: bool, # noqa: FBT001
794+
exmax: bool, # noqa: FBT001
795795
) -> bool:
796796
"""If the given range from `start` to `end` has any numbers divisible by `divisor`."""
797797
divisible_num = end // divisor - start // divisor

src/hypothesis_jsonschema/_cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
app = typer.Typer(help="Hypothesis JSONSchema CLI")
1111

1212

13-
def version_callback(value: bool) -> None:
13+
def version_callback(value: bool) -> None: # noqa: FBT001
1414
"""Callback to show the version of memtab"""
1515
if value:
1616
print(vers("hypothesis-jsonschema"))
17-
raise typer.Exit()
17+
raise typer.Exit(0)
1818

1919

2020
@app.command()
@@ -45,4 +45,5 @@ def main(
4545

4646
for _ in range(num):
4747
ex = sample.example()
48+
print(json.dumps(ex))
4849
typer.Exit(0)

src/hypothesis_jsonschema/_from_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def __from_schema(
185185
)
186186
if name in STRING_FORMATS:
187187
warnings.warn(
188-
f"Overriding standard format {name!r} - was " f"{STRING_FORMATS[name]!r}, now {strat!r}",
188+
f"Overriding standard format {name!r} - was {STRING_FORMATS[name]!r}, now {strat!r}",
189189
HypothesisWarning,
190190
stacklevel=2,
191191
)

0 commit comments

Comments
 (0)