Skip to content

Commit cbd9343

Browse files
committed
chore: Add --diff to black to debug git job issues.
1 parent a968599 commit cbd9343

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

.githooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eo pipefail
44

55
# lint
6-
poetry run black --check .
6+
poetry run black --check --diff .
77
poetry run isort --check-only .
88
poetry run flake8 .
99
poetry run mypy .

smpclient/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _prettify_validation_error(exc: ValidationError) -> str:
6969
err_type = err["type"]
7070
msg = err["msg"]
7171
loc = ".".join(str(x) for x in err["loc"])
72-
lines.append(f"\t\t[{err_type}] {msg}: {loc}")
72+
lines.append(f"\t\t[{err_type}] {msg}: {loc}; input: {err['input']})")
7373
return "\n".join(lines)
7474

7575

@@ -87,9 +87,7 @@ def _create_smp_validation_exception(
8787
details += f"Frame:\n{_hexdump_ascii(frame)}\n"
8888
details += "Errors:\n"
8989
for cls, exc in errs.items():
90-
details += (
91-
f"\tCould not be parsed as {cls.__name__} because:\n{_prettify_validation_error(exc)}\n"
92-
)
90+
details += f"\tCould not be parsed as {cls.__name__} because {len(exc.errors())} errors:\n{_prettify_validation_error(exc)}\n"
9391

9492
return SMPValidationException(msg=msg, details=details)
9593

@@ -233,7 +231,7 @@ async def request(
233231
except ValidationError as e:
234232
errs[request._ErrorV2] = e
235233
exc = _create_smp_validation_exception(header, frame, errs)
236-
logger.error(exc.details)
234+
logger.error(exc.msg + exc.details)
237235
raise exc from None
238236

239237
async def upload(

0 commit comments

Comments
 (0)