Skip to content

Commit a41eeb5

Browse files
committed
Update to follow --ignore pattern followed by scancode
Signed-off-by: Ravi <jravi248@gmail.com>
1 parent a94f942 commit a41eeb5

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/extractcode/archive.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from commoncode import functional
3737
from commoncode.system import on_linux
3838
from commoncode.system import py2
39+
from commoncode.ignore import is_ignored
3940

4041
from typecode import contenttype
4142

@@ -109,12 +110,9 @@ def should_extract(location, ignored_extensions, kinds):
109110
kinds
110111
"""
111112
location = os.path.abspath(os.path.expanduser(location))
112-
shouldIgnore = False
113-
for extension in ignored_extensions:
114-
if(location.endswith(extension)):
115-
shouldIgnore = True
116-
break
117-
if get_extractor(location, kinds):
113+
ignored_extensions = {extension : 'User ignore: Supplied by --ignore' for extension in ignored_extensions}
114+
shouldIgnore = is_ignored(location, ignored_extensions)
115+
if get_extractor(location, kinds) and not shouldIgnore:
118116
return True
119117

120118

0 commit comments

Comments
 (0)