File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
cycode/cli/files_collector
tests/cli/files_collector Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 1010
1111_SUPPORTED_IGNORE_PATTERN_FILES = {'.gitignore' , '.cycodeignore' }
1212_DEFAULT_GLOBAL_IGNORE_PATTERNS = [
13- '.git' ,
14- '.cycode' ,
15- '**/.git/**' ,
16- '**/.cycode/**' ,
13+ '**/.git' ,
14+ '**/.cycode' ,
1715]
1816
1917
@@ -67,7 +65,7 @@ def walk_ignore(path: str) -> List[str]:
6765
6866 # decrease recursion depth of os.walk() because of topdown=True by changing the list in-place
6967 # slicing ([:]) is mandatory to change dict in-place!
70- dirnames [:] = [d for d in dirnames if _should_include_path (ignore_patterns , d )]
71- filenames [:] = [f for f in filenames if _should_include_path (ignore_patterns , f )]
68+ dirnames [:] = [d for d in dirnames if _should_include_path (ignore_patterns , os . path . join ( dirpath , d ) )]
69+ filenames [:] = [f for f in filenames if _should_include_path (ignore_patterns , os . path . join ( dirpath , f ) )]
7270
7371 yield dirpath , dirnames , filenames
Original file line number Diff line number Diff line change @@ -87,12 +87,10 @@ def test_get_global_ignore_patterns(fs: 'FakeFilesystem') -> None:
8787 _create_mocked_file_structure (fs )
8888 ignore_patterns = _get_global_ignore_patterns ('/home/user/project/subdir' )
8989
90- assert len (ignore_patterns ) == 7
90+ assert len (ignore_patterns ) == 5
9191 # default global:
92- assert '.git' in ignore_patterns
93- assert '.cycode' in ignore_patterns
94- assert '**/.git/**' in ignore_patterns
95- assert '**/.cycode/**' in ignore_patterns
92+ assert '**/.git' in ignore_patterns
93+ assert '**/.cycode' in ignore_patterns
9694 # additional:
9795 assert '*.txt' in ignore_patterns
9896 assert '*.pyc' in ignore_patterns
You can’t perform that action at this time.
0 commit comments