Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2023-05-05 16:24:28 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2023-05-05 16:24:28 +0300
commit9658ffbf216528b5a2b306e9204b531942409c9a (patch)
tree0df2c169e072c45d7415e6758b83f4e745efa7f8
parent97ed5181c3f06e4241ad8c160e0e19b951209318 (diff)
Avoid spurious license normalization warnings over whitespace
-rwxr-xr-xcalm/hint.py4
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)