From 9658ffbf216528b5a2b306e9204b531942409c9a Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 5 May 2023 14:24:28 +0100 Subject: Avoid spurious license normalization warnings over whitespace --- calm/hint.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/calm/hint.py b/calm/hint.py index 71fa7b9..c202f8c 100755 --- a/calm/hint.py +++ b/calm/hint.py @@ -297,6 +297,10 @@ def hint_file_parse(fn, kind, strict=False): # license must be a valid spdx license expression if key == 'license' and licensing: + # first, normalize whitespace in license, so we don't + # get spurious normalization warnings over whitespace + value = re.sub(r'\s+', ' ', value) + try: licensing.parse(value, strict=True) le = licensing.validate(value, strict=True) -- cgit v1.2.3