From 4a6234237ab7ee2c7817be29c20b1e6f08f27985 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Fri, 29 Dec 2023 08:21:22 +0100 Subject: [PATCH] linting --- dotdrop/utils.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/dotdrop/utils.py b/dotdrop/utils.py index a7dac14e..af4917fe 100644 --- a/dotdrop/utils.py +++ b/dotdrop/utils.py @@ -233,9 +233,9 @@ def _match_ignore_pattern(path, pattern, debug=False): """ subpath = path while subpath != os.path.sep: - #if debug: - # msg = f'fnmatch \"{subpath}\" against {pattern}' - # LOG.dbg(msg, force=True) + # if debug: + # msg = f'fnmatch \"{subpath}\" against {pattern}' + # LOG.dbg(msg, force=True) ret = fnmatch.fnmatch(subpath, pattern) if ret: if debug: @@ -277,10 +277,11 @@ def _must_ignore(path, ignores, neg_ignores, debug=False): msg = f'NO MATCH negative ignore \"{pattern}\" against {path}' LOG.dbg(msg, force=True) continue - else: - if debug: - msg = f'MATCH negative ignore \"{pattern}\" against {path}' - LOG.dbg(msg, force=True) + + if debug: + msg = f'MATCH negative ignore \"{pattern}\" against {path}' + LOG.dbg(msg, force=True) + # remove from the list try: match_ignore_pattern.remove(path) @@ -292,10 +293,7 @@ def _must_ignore(path, ignores, neg_ignores, debug=False): warn += 'that is being ignored by a ' warn += 'previous ignore pattern.' LOG.warn(warn) - print(path) - print(match_ignore_pattern) - print(os.path.isdir(path)) - print(neg_ignore_cnt) + if len(match_ignore_pattern) < 1: # if debug: # LOG.dbg(f'NOT ignoring \"{path}\"', force=True)