|
4 | 4 | from cycode.cli.logger import get_logger |
5 | 5 | from cycode.cli.utils.ignore_utils import IgnoreFilterManager |
6 | 6 |
|
7 | | -logger = get_logger('File Ignore') |
| 7 | +logger = get_logger('Ignores') |
8 | 8 |
|
9 | 9 | _SUPPORTED_IGNORE_PATTERN_FILES = { |
10 | 10 | '.gitignore', |
@@ -43,15 +43,17 @@ def walk_ignore(path: str) -> Generator[tuple[str, list[str], list[str]], None, |
43 | 43 | global_ignore_file_paths=_collect_top_level_ignore_files(path), |
44 | 44 | global_patterns=_DEFAULT_GLOBAL_IGNORE_PATTERNS, |
45 | 45 | ) |
46 | | - |
47 | 46 | for dirpath, dirnames, filenames, ignored_dirnames, ignored_filenames in ignore_filter_manager.walk_with_ignored(): |
48 | 47 | rel_dirpath = '' if dirpath == path else os.path.relpath(dirpath, path) |
49 | 48 | display_dir = rel_dirpath or '.' |
50 | | - for kind, names in ( |
51 | | - ('directory', ignored_dirnames), |
52 | | - ('file', ignored_filenames), |
| 49 | + for is_dir, names in ( |
| 50 | + (True, ignored_dirnames), |
| 51 | + (False, ignored_filenames), |
53 | 52 | ): |
54 | 53 | for name in names: |
55 | | - logger.debug('Skipping matched %s %s/%s', kind, display_dir, name) |
| 54 | + full_path = os.path.join(path, display_dir, name) |
| 55 | + if is_dir: |
| 56 | + full_path = os.path.join(full_path, '*') |
| 57 | + logger.debug('Ignoring match %s', full_path) |
56 | 58 |
|
57 | 59 | yield dirpath, dirnames, filenames |
0 commit comments