diff --git a/hancho.py b/hancho.py index c0d356d..b231c93 100755 --- a/hancho.py +++ b/hancho.py @@ -13,7 +13,6 @@ import subprocess import sys import traceback -from turtle import st import types from pathlib import Path from glob import glob @@ -72,8 +71,7 @@ def swap_ext(name, new_ext): return None if isinstance(name, list): return [swap_ext(n, new_ext) for n in name] - else: - return Path(name).with_suffix(new_ext) + return Path(name).with_suffix(new_ext) def mtime(filename): @@ -163,7 +161,9 @@ def expand_async(rule, template): # expression directly to the output for debugging. replacement = "" try: - replacement = eval(exp[1:-1], globals(), rule) # pylint: disable=eval-used + replacement = eval( + exp[1:-1], globals(), rule + ) # pylint: disable=eval-used except Exception: # pylint: disable=broad-except replacement = exp @@ -217,7 +217,6 @@ async def await_variant(variant): return variant - ################################################################################ @@ -619,6 +618,7 @@ async def run_async(self): ######################################## + # pylint: disable=too-many-branches async def task_main(self): """ All the steps needed to run a task and check the result. @@ -680,7 +680,9 @@ async def task_main(self): ######################################## def flatten(self): - # Flatten all filename promises in any of the input filename arrays. + """ + Flatten all filename promises in any of the input filename arrays. + """ self.files_in = flatten(self.files_in) self.files_out = flatten(self.files_out) self.deps = flatten(self.deps) diff --git a/tests/test.py b/tests/test.py index 37a8d47..acc1943 100755 --- a/tests/test.py +++ b/tests/test.py @@ -52,6 +52,7 @@ def run_hancho(name): ################################################################################ +# pylint: disable=too-many-public-methods class TestHancho(unittest.TestCase): """Basic test cases""" @@ -193,6 +194,9 @@ def test_sync_command(self): self.assertTrue(path.exists("build/result.txt")) def test_cancellation(self): + """ + A task that receives a cancellation exception should not run. + """ self.assertNotEqual(0, run_hancho("cancellation")) self.assertTrue(Path("build/pass_result.txt").exists()) self.assertFalse(Path("build/fail_result.txt").exists())