Skip to content

Commit 4ae5cd2

Browse files
committed
Fix Ruff lint errors line-too-long (E501)
This commit fixes the following lint errors: ```console pp@DESKTOP-89OPGF3 MINGW64 /c/temp/kaitai_struct/runtime/python (master) $ ruff --version ruff 0.14.10 pp@DESKTOP-89OPGF3 MINGW64 /c/temp/kaitai_struct/runtime/python (master) $ ruff check --statistics $(git ls-files '*.py') 3 E501 line-too-long Found 3 errors. pp@DESKTOP-89OPGF3 MINGW64 /c/temp/kaitai_struct/runtime/python (master) $ ruff check $(git ls-files '*.py') E501 Line too long (92 > 88) --> kaitaistruct.py:489:89 | 487 | actual = self._io.read(len(expected)) 488 | if actual != expected: 489 | msg = f"unexpected fixed contents: got {actual!r}, was waiting for {expected!r}" | ^^^^ 490 | # NOTE: this method has always raised `Exception` directly and is now 491 | # unused and slated for removal, so there's no point in "fixing" it. | E501 Line too long (101 > 88) --> kaitaistruct.py:533:89 | 531 | num_bytes_left = full_size - pos 532 | if n > num_bytes_left: 533 | msg = f"requested to write {n} bytes, but only {num_bytes_left} bytes left in the stream" | ^^^^^^^^^^^^^ 534 | raise EndOfStreamError(msg, n, num_bytes_left) | E501 Line too long (109 > 88) --> kaitaistruct.py:1105:89 | 1103 | def __init__(self): 1104 | super().__init__( 1105 | "consistency not checked: _check() has not been called since the last modification of the object" | ^^^^^^^^^^^^^^^^^^^^^ 1106 | ) | Found 3 errors. ```
1 parent 85c545d commit 4ae5cd2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

kaitaistruct.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,10 @@ def ensure_fixed_contents(self, expected):
486486
)
487487
actual = self._io.read(len(expected))
488488
if actual != expected:
489-
msg = f"unexpected fixed contents: got {actual!r}, was waiting for {expected!r}"
489+
msg = (
490+
f"unexpected fixed contents: got {actual!r}, "
491+
f"was waiting for {expected!r}"
492+
)
490493
# NOTE: this method has always raised `Exception` directly and is now
491494
# unused and slated for removal, so there's no point in "fixing" it.
492495
raise Exception(msg) # noqa: TRY002
@@ -530,7 +533,10 @@ def _ensure_bytes_left_to_write(self, n, pos):
530533

531534
num_bytes_left = full_size - pos
532535
if n > num_bytes_left:
533-
msg = f"requested to write {n} bytes, but only {num_bytes_left} bytes left in the stream"
536+
msg = (
537+
f"requested to write {n} bytes, but only "
538+
f"{num_bytes_left} bytes left in the stream"
539+
)
534540
raise EndOfStreamError(msg, n, num_bytes_left)
535541

536542
# region Integer numbers
@@ -1102,5 +1108,6 @@ class ConsistencyNotCheckedError(Exception):
11021108

11031109
def __init__(self):
11041110
super().__init__(
1105-
"consistency not checked: _check() has not been called since the last modification of the object"
1111+
"consistency not checked: _check() has not been called "
1112+
"since the last modification of the object"
11061113
)

0 commit comments

Comments
 (0)