diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2023-05-05 16:24:28 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2023-05-05 16:24:28 +0300 |
commit | 9658ffbf216528b5a2b306e9204b531942409c9a (patch) | |
tree | 0df2c169e072c45d7415e6758b83f4e745efa7f8 | |
parent | 97ed5181c3f06e4241ad8c160e0e19b951209318 (diff) |
Avoid spurious license normalization warnings over whitespace
-rwxr-xr-x | calm/hint.py | 4 |
1 files changed, 4 insertions, 0 deletions
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) |