MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / is_ignored

Function is_ignored

src/commoncode/resource.py:114–147  ·  view source on GitHub ↗
(location,  includes=tuple(), excludes=tuple())

Source from the content-addressed store, hash-verified

112
113
114def is_ignored(location, includes=tuple(), excludes=tuple()):
115
116 excludes = {
117 pattern: 'User ignore: Supplied by --ignore' for pattern in excludes
118 }
119
120 includes = {
121 pattern: 'User include: Supplied by --include' for pattern in includes
122 }
123
124 included_from_options = is_included(
125 path=location,
126 includes=includes,
127 excludes=excludes,
128 )
129
130 if TRACE_DEEP:
131 logger_debug(
132 "Codebase.populate: walk: is_ignored:",
133 "is_ignored: location:",
134 location,
135 "included_from_options:",
136 included_from_options,
137 "skip_ignored",
138 skip_ignored(location)
139 )
140
141 if skip_ignored(location) or not included_from_options:
142 if TRACE_DEEP:
143 logger_debug("is_ignored: location:", location, "is_skipped",)
144
145 return True
146
147 return False
148
149
150def depth_walk(

Callers

nothing calls this directly

Calls 3

is_includedFunction · 0.90
skip_ignoredFunction · 0.85
logger_debugFunction · 0.70

Tested by

no test coverage detected