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

Function get_multiline_description

src/packagedcode/spec.py:256–286  ·  view source on GitHub ↗

Return a multiline description given the ``description_start`` start of the decsription and a ``lines`` list. These are common in .podspec. https://guides.cocoapods.org/syntax/podspec.html#description description is in the form: spec.description = <<-DESC Computes the

(description_start, lines)

Source from the content-addressed store, hash-verified

254
255
256def get_multiline_description(description_start, lines):
257 """
258 Return a multiline description given the ``description_start`` start of the
259 decsription and a ``lines`` list. These are common in .podspec.
260
261 https://guides.cocoapods.org/syntax/podspec.html#description
262 description is in the form:
263 spec.description = <<-DESC
264 Computes the meaning of life.
265 Features:
266 1. Is self aware
267 ...
268 42. Likes candies.
269 DESC
270 """
271 # from "<<-DESC" to "DESC"
272 description_end = description_start.strip('<-')
273 description_lines = []
274 started = False
275 for line in lines:
276 if started:
277 ended = line.strip().startswith(description_end)
278 if not ended:
279 description_lines.append(line)
280 else:
281 break
282
283 elif '.description' in line and description_start in line:
284 started = True
285
286 return '\n'.join(description_lines)

Callers 1

parse_specFunction · 0.85

Calls 2

appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected