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

Function streamline_errors

src/scancode/cli_test_utils.py:303–313  ·  view source on GitHub ↗

Modify the `errors` list in place to make it easier to test

(errors)

Source from the content-addressed store, hash-verified

301
302
303def streamline_errors(errors):
304 """
305 Modify the `errors` list in place to make it easier to test
306 """
307 for i, error in enumerate(errors[:]):
308 error_lines = error.splitlines(True)
309 if len(error_lines) <= 1:
310 continue
311 # keep only first and last line
312 cleaned_error = ''.join([error_lines[0] + error_lines[-1]])
313 errors[i] = cleaned_error
314
315
316def streamline_headers(headers):

Callers 2

streamline_headersFunction · 0.85
streamline_scanned_fileFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected