From caa77da9568fb7c48c9db679cf9dc0ae20080585 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Mon, 19 Aug 2024 01:07:01 +0000 Subject: [PATCH] Do not warn about using "and" / "or" in License: fields "and" and "or" are semantically different, so we should not discourage their use. See: https://crbug.com/355672411#comment11 Bug: 355672411 Change-Id: I95aa204da5550747ec67ccb6e42b87e6ac042b0b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5783166 Auto-Submit: Andrew Grieve Reviewed-by: Anne Redulla Commit-Queue: Anne Redulla --- metadata/fields/custom/license.py | 7 ------- metadata/tests/fields_test.py | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/metadata/fields/custom/license.py b/metadata/fields/custom/license.py index d1e3578d2..507f60fe8 100644 --- a/metadata/fields/custom/license.py +++ b/metadata/fields/custom/license.py @@ -127,17 +127,10 @@ class LicenseField(field_types.SingleLineTextField): return vr.ValidationWarning( reason=f"{self._name} has a license not in the allowlist.", additional=[ - f"Separate licenses using a '{self.VALUE_DELIMITER}'.", "Licenses not allowlisted: " f"{util.quoted(not_allowlisted)}.", ]) - # Suggest using the standard value delimiter when possible. - if (len(licenses) > 1 and re.search(_PATTERN_VERBOSE_DELIMITER, value) - and self.VALUE_DELIMITER not in value): - return vr.ValidationWarning( - reason=f"Separate licenses using a '{self.VALUE_DELIMITER}'.") - return None def narrow_type(self, value: str) -> Optional[List[str]]: diff --git a/metadata/tests/fields_test.py b/metadata/tests/fields_test.py index e2214bc09..148233327 100644 --- a/metadata/tests/fields_test.py +++ b/metadata/tests/fields_test.py @@ -120,13 +120,13 @@ class FieldValidationTest(unittest.TestCase): "GPL v2 or later", "LGPL2 with the classpath exception", "Apache, Version 2 and Public domain", + "Public domain or MPL 2", + "APSL 2 and the MIT license", ], error_values=["", "\n", ",", "Apache 2.0 / MIT / "], warning_values=[ "Custom license", "Custom / MIT", - "Public domain or MPL 2", - "APSL 2 and the MIT license", ], )