debian/tests/pychunk: reformat, 100 chars per line.
authorPeter Pentchev <roam@debian.org>
Fri, 12 Aug 2022 08:51:42 +0000 (11:51 +0300)
committerPeter Pentchev <roam@debian.org>
Fri, 12 Aug 2022 08:51:42 +0000 (11:51 +0300)
debian/tests/pychunk/common.py
debian/tests/pychunk/compile.py
debian/tests/pychunk/roundtrip.py
debian/tests/pyproject.toml
debian/tests/setup.cfg

index acf00b24abf14a38ca2065fc53e0e1a2013b3ccf..a64e4246e31f07192bc5ae99372403398e939952 100644 (file)
@@ -79,16 +79,11 @@ def do_compress(cfg: Config, orig_size: int) -> int:
     comp_size = cfg.compressed.stat().st_size
     print(f"{cfg.compressed} size is {comp_size} bytes long")
     if comp_size >= orig_size:
-        sys.exit(
-            f"sizeof({cfg.compressed}) == {comp_size} : "
-            f"sizeof({cfg.orig}) == {orig_size}"
-        )
+        sys.exit(f"sizeof({cfg.compressed}) == {comp_size} : sizeof({cfg.orig}) == {orig_size}")
     start = cfg.compressed.open(mode="rb").read(5)
     print(f"{cfg.compressed} starts with {start!r}")
     if start != defs.MAGIC:
-        sys.exit(
-            f"{cfg.compressed} does not start with {defs.MAGIC!r}: {start!r}"
-        )
+        sys.exit(f"{cfg.compressed} does not start with {defs.MAGIC!r}: {start!r}")
 
     return comp_size
 
@@ -147,28 +142,17 @@ def read_chunks(cfg: Config, orig_size: int, comp_size: int) -> Chunk:
             end=last_chunk.end + size,
         )
         if next_chunk.cend > comp_size:
-            sys.exit(
-                f"Compressed size overflow: {next_chunk.cend} > {comp_size}"
-            )
+            sys.exit(f"Compressed size overflow: {next_chunk.cend} > {comp_size}")
 
         more = idx + 1 != params["chunk_count"]
         if more:
             if next_chunk.end >= orig_size:
-                sys.exit(
-                    f"Original size overflow: "
-                    f"{next_chunk.end} >= {orig_size}"
-                )
+                sys.exit(f"Original size overflow: {next_chunk.end} >= {orig_size}")
         else:
             if next_chunk.cend != comp_size:
-                sys.exit(
-                    f"Compressed size mismatch: "
-                    f"{next_chunk.cend} != {comp_size}"
-                )
+                sys.exit(f"Compressed size mismatch: {next_chunk.cend} != {comp_size}")
             if next_chunk.end != orig_size:
-                sys.exit(
-                    f"Original size mismatch: "
-                    f"{next_chunk.end} != {orig_size}"
-                )
+                sys.exit(f"Original size mismatch: {next_chunk.end} != {orig_size}")
 
         print(f"- appending {next_chunk!r}")
         chunks.append(next_chunk)
@@ -207,9 +191,7 @@ def read_chunks(cfg: Config, orig_size: int, comp_size: int) -> Chunk:
 
         size = int(data.group("size"))
         if size < 1 or size > comp_size:
-            sys.exit(
-                f"zck_read_header said data size {size} (comp {comp_size})"
-            )
+            sys.exit(f"zck_read_header said data size {size} (comp {comp_size})")
         params["size_diff"] = comp_size - size
 
         return "wait_for_chunk_count"
index e87e09c516b6a5c785c9df6f4e44fee2a2203a2b..4262691bd823d8ea905c0400baf75f70171e4b18 100755 (executable)
@@ -53,9 +53,7 @@ def do_compile(cfg: Config) -> None:
     """Compile the test program."""
     print("Fetching the C compiler flags for zck")
     cflags = (
-        subprocess.check_output(
-            ["pkg-config", "--cflags", "zck"], shell=False, env=cfg.env
-        )
+        subprocess.check_output(["pkg-config", "--cflags", "zck"], shell=False, env=cfg.env)
         .decode("UTF-8")
         .rstrip("\r\n")
     )
@@ -72,9 +70,7 @@ def do_compile(cfg: Config) -> None:
 
     print("Fetching the C linker flags and libraries for zck")
     libs = (
-        subprocess.check_output(
-            ["pkg-config", "--libs", "zck"], shell=False, env=cfg.env
-        )
+        subprocess.check_output(["pkg-config", "--libs", "zck"], shell=False, env=cfg.env)
         .decode("UTF-8")
         .rstrip("\r\n")
     )
@@ -112,16 +108,10 @@ def compare_chunk(cfg: Config, second: common.Chunk, orig_size: int) -> None:
     # OK, let's load it all into memory, mmkay?
     contents = cfg.orig.read_bytes()
     if len(contents) != orig_size:
-        sys.exit(
-            f"Could not read {orig_size} bytes from {cfg.orig}, "
-            f"read {len(contents)}"
-        )
+        sys.exit(f"Could not read {orig_size} bytes from {cfg.orig}, read {len(contents)}")
     chunk = cfg.uncompressed.read_bytes()
     if len(chunk) != second.size:
-        sys.exit(
-            f"Could not read {second.size} bytes from {cfg.uncompressed}, "
-            f"read {len(chunk)}"
-        )
+        sys.exit(f"Could not read {second.size} bytes from {cfg.uncompressed}, read {len(chunk)}")
 
     if contents[second.start : second.start + second.size] != chunk:
         sys.exit("Mismatch!")
index b7b003ff8a5d159e8232b1e43cb731d3009f1354..6c054e87c75e6e62db1689da37e07b15b7df66c7 100755 (executable)
@@ -68,9 +68,7 @@ def do_uncompress(cfg: Config, orig_size: int) -> None:
         sys.exit(f"Uncompressed size {new_size} != original size {orig_size}")
 
     print(f"Comparing {cfg.orig} to {cfg.uncompressed}")
-    subprocess.check_call(
-        ["cmp", "--", cfg.orig, cfg.uncompressed], shell=False, env=cfg.env
-    )
+    subprocess.check_call(["cmp", "--", cfg.orig, cfg.uncompressed], shell=False, env=cfg.env)
 
 
 def do_recompress(cfg: Config, comp_size: int) -> None:
@@ -93,9 +91,7 @@ def do_recompress(cfg: Config, comp_size: int) -> None:
     new_size = cfg.recompressed.stat().st_size
     print(f"Recompressed size {new_size}")
     if new_size != comp_size:
-        sys.exit(
-            f"Recompressed size {new_size} != compressed size {comp_size}"
-        )
+        sys.exit(f"Recompressed size {new_size} != compressed size {comp_size}")
 
     print(f"Comparing {cfg.compressed} to {cfg.recompressed}")
     subprocess.check_call(
index 783a0c5589516b18caedfd17f0b60de795b790bd..f3592effed26cd68c33d6a2d255ed5f86ae4c693 100644 (file)
@@ -1,5 +1,5 @@
 [tool.black]
-line-length = 79
+line-length = 100
 
 [tool.mypy]
 strict = true
index b6c4e5828267f3d0e037f99dc37a0299bd06462e..64a874ae185074ae3a1347abec37bbd6d6d59872 100644 (file)
@@ -1,3 +1,4 @@
 [flake8]
 # Leave the formatting to the black tool.
 extend-ignore = E203
+max-line-length = 100