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

Function get_value

src/packagedcode/spec.py:76–84  ·  view source on GitHub ↗

Return the value for the ``name`` attribute collected using the ``matcher`` regex in the ``line`` text.

(name, matcher, line, clean=True)

Source from the content-addressed store, hash-verified

74
75
76def get_value(name, matcher, line, clean=True):
77 """
78 Return the value for the ``name`` attribute collected using the ``matcher``
79 regex in the ``line`` text.
80 """
81 match = matcher.match(line)
82 if match:
83 value = match.group(name)
84 return get_cleaned_string(value) if clean else value
85
86
87# FIXME: this does not smell right as we ignore the matched value

Callers 1

get_podspec_sourceFunction · 0.85

Calls 3

get_cleaned_stringFunction · 0.85
matchMethod · 0.80
groupMethod · 0.80

Tested by

no test coverage detected