Эх сурвалжийг харах

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 <agrieve@chromium.org>
Reviewed-by: Anne Redulla <aredulla@google.com>
Commit-Queue: Anne Redulla <aredulla@google.com>
Andrew Grieve 1 жил өмнө
parent
commit
caa77da956

+ 0 - 7
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]]:

+ 2 - 2
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",
             ],
         )