mirror of
https://github.com/kirill-markin/repo-to-text.git
synced 2025-12-06 03:22:23 -08:00
strict-typing-and-error-handling
This commit is contained in:
parent
5e1ae59375
commit
e39e7a8896
6 changed files with 36 additions and 519 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
import shutil
|
||||
import logging
|
||||
from typing import List
|
||||
from typing import List, Set
|
||||
|
||||
def setup_logging(debug: bool = False) -> None:
|
||||
"""Set up logging configuration.
|
||||
|
|
@ -55,8 +55,8 @@ def remove_empty_dirs(tree_output: str, path: str = '.') -> str:
|
|||
"""
|
||||
logging.debug('Removing empty directories from tree output')
|
||||
lines = tree_output.splitlines()
|
||||
non_empty_dirs = set()
|
||||
filtered_lines = []
|
||||
non_empty_dirs: Set[str] = set()
|
||||
filtered_lines: List[str] = []
|
||||
|
||||
for line in lines:
|
||||
parts = line.strip().split()
|
||||
|
|
@ -68,7 +68,7 @@ def remove_empty_dirs(tree_output: str, path: str = '.') -> str:
|
|||
non_empty_dirs.add(os.path.dirname(full_path))
|
||||
filtered_lines.append(line)
|
||||
|
||||
final_lines = []
|
||||
final_lines: List[str] = []
|
||||
for line in filtered_lines:
|
||||
parts = line.strip().split()
|
||||
if parts:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue