Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
deadc0de6 committed Jan 31, 2024
1 parent a24cbee commit 95168be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ build/
tags
env
venv
.pytest_cache
.mypy_cache

# coverage stuff
.coverage
Expand Down
6 changes: 3 additions & 3 deletions dotdrop/ftree.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ 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)
for dname in dirs:
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
# but also the directory itself
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)
Expand Down
3 changes: 1 addition & 2 deletions dotdrop/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 95168be

Please sign in to comment.