From 95168be4b0a3a8e7b2068eb4d34a176461cf88aa Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Wed, 31 Jan 2024 21:36:45 +0100 Subject: [PATCH] linting --- .gitignore | 2 ++ dotdrop/ftree.py | 6 +++--- dotdrop/importer.py | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f7b26362..4c898ba0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ build/ tags env venv +.pytest_cache +.mypy_cache # coverage stuff .coverage diff --git a/dotdrop/ftree.py b/dotdrop/ftree.py index 3878a423..4d6c888b 100644 --- a/dotdrop/ftree.py +++ b/dotdrop/ftree.py @@ -38,7 +38,7 @@ def _walk(self): fpath = os.path.join(root, file) if must_ignore([fpath], ignores=self.ignores, debug=self.debug, strict=True): - self.log.dbg('ignoring file {fpath}') + self.log.dbg(f'ignoring file {fpath}') continue self.log.dbg(f'added file to list of {self.path}: {fpath}') self.entries.append(fpath) @@ -46,7 +46,7 @@ def _walk(self): dpath = os.path.join(root, dname) if dir_empty(dpath): # ignore empty directory - self.log.dbg('ignoring empty dir {dpath}') + self.log.dbg(f'ignoring empty dir {dpath}') continue # appending "/" allows to ensure pattern # like "*/dir/*" will match the content of the directory @@ -54,7 +54,7 @@ def _walk(self): dpath += os.path.sep if must_ignore([dpath], ignores=self.ignores, debug=self.debug, strict=True): - self.log.dbg('ignoring dir {dpath}') + self.log.dbg(f'ignoring dir {dpath}') continue self.log.dbg(f'added dir to list of {self.path}: {dpath}') self.entries.append(dpath) diff --git a/dotdrop/importer.py b/dotdrop/importer.py index d014a43a..602598f6 100644 --- a/dotdrop/importer.py +++ b/dotdrop/importer.py @@ -251,7 +251,6 @@ def _import_to_dotpath(self, in_dotpath, in_fs, trans_update=None): self.log.dbg(f"trans failed: {in_fs}") return False - if not os.path.isdir(in_fs): # handle file self._import_file_to_dotpath(in_fs, in_dotpath_abs) @@ -263,7 +262,7 @@ def _import_to_dotpath(self, in_dotpath, in_fs, trans_update=None): self.log.dbg(f'{len(fstree.get_entries())} files to import') for entry in fstree.get_entries(): - self.log.dbg("importing {entry}...") + self.log.dbg(f"importing {entry}...") src = os.path.join(in_fs, entry) rel_src = os.path.relpath(entry, in_fs) dst = os.path.join(in_dotpath_abs, rel_src)