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

Function set_ignorables

src/licensedcode/models.py:2894–2906  ·  view source on GitHub ↗

Update ``licensish`` Rule or License using the mapping of ``ignorables`` attributes. Display progress messages if ``verbose`` is True.

(licensish, ignorables, verbose=False)

Source from the content-addressed store, hash-verified

2892
2893
2894def set_ignorables(licensish, ignorables, verbose=False):
2895 """
2896 Update ``licensish`` Rule or License using the mapping of ``ignorables``
2897 attributes.
2898
2899 Display progress messages if ``verbose`` is True.
2900 """
2901 for key, value in ignorables.items():
2902 if verbose:
2903 existing = getattr(licensish, key, None)
2904 print(f'Updating ignorable: {key} from: {existing!r} to: {value!r}')
2905 setattr(licensish, key, value)
2906 return licensish
2907
2908
2909def get_ignorables(text, verbose=False):

Callers 1

update_ignorablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected