From 5f593e35c886420e5205b699225bd624a0f331e9 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 21 Sep 2022 10:12:15 -0500 Subject: [PATCH] chore: linting --- src/help.py | 14 +++++++++----- task.mk | 16 ++++++++++------ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/help.py b/src/help.py index 1f22030..77691ff 100644 --- a/src/help.py +++ b/src/help.py @@ -37,13 +37,15 @@ def gen_makefile(): return makefile -def parse_help(file,hidden=False): +def parse_help(file, hidden=False): for line in file.splitlines(): match = pattern.search(line) if match: - if not hidden and not os.getenv("SHOW_HIDDEN") and str( - match.groupdict().get("goal") - ).startswith("_"): + if ( + not hidden + and not os.getenv("SHOW_HIDDEN") + and str(match.groupdict().get("goal")).startswith("_") + ): pass else: yield {k: v for k, v in match.groupdict().items() if v is not None} @@ -51,7 +53,9 @@ def parse_help(file,hidden=False): def recipe_help_header(goal): item = [ - i for i in list(parse_help(gen_makefile(),hidden=True)) if "goal" in i and goal == i["goal"] + i + for i in list(parse_help(gen_makefile(), hidden=True)) + if "goal" in i and goal == i["goal"] ] if item: return fmt_goal( diff --git a/task.mk b/task.mk index 436ce7c..667c0db 100644 --- a/task.mk +++ b/task.mk @@ -1,7 +1,7 @@ # }> [github.com/daylinmorgan/task.mk] <{ # # Copyright (c) 2022 Daylin Morgan # MIT License -# version: v22.9.19-3-g81a0031-dev +# version: v22.9.19-4-g071f7fc-dev # # task.mk should be included at the bottom of your Makefile with `-include .task.mk` # See below for the standard configuration options that should be set prior to including this file. @@ -102,19 +102,23 @@ def gen_makefile(): with open(file, "r") as f: makefile += f.read() + "\n\n" return makefile -def parse_help(file,hidden=False): +def parse_help(file, hidden=False): for line in file.splitlines(): match = pattern.search(line) if match: - if not hidden and not os.getenv("SHOW_HIDDEN") and str( - match.groupdict().get("goal") - ).startswith("_"): + if ( + not hidden + and not os.getenv("SHOW_HIDDEN") + and str(match.groupdict().get("goal")).startswith("_") + ): pass else: yield {k: v for k, v in match.groupdict().items() if v is not None} def recipe_help_header(goal): item = [ - i for i in list(parse_help(gen_makefile(),hidden=True)) if "goal" in i and goal == i["goal"] + i + for i in list(parse_help(gen_makefile(), hidden=True)) + if "goal" in i and goal == i["goal"] ] if item: return fmt_goal(