@@ -160,8 +160,12 @@ <h1 class="title">Module <code>mbed_tools_ci_scripts.utils.third_party_licences<
160160 self.load()
161161 if not self._licence_store or not self._licence_list:
162162 return None
163- matching_licences = [l for l in self._licence_list if licence_descriptor_pattern.match(l)]
164- return [cast(Licence, self._licence_store.get(l)) for l in matching_licences] if matching_licences else None
163+ matching_licences = [licence for licence in self._licence_list if licence_descriptor_pattern.match(licence)]
164+ return (
165+ [cast(Licence, self._licence_store.get(licence)) for licence in matching_licences]
166+ if matching_licences
167+ else None
168+ )
165169
166170 def get_licence(self, licence_descriptor: Optional[str]) -> Optional[Licence]:
167171 """Determines the licence based on a string descriptor e.g. Apache 2."""
@@ -249,8 +253,8 @@ <h1 class="title">Module <code>mbed_tools_ci_scripts.utils.third_party_licences<
249253def determine_whether_licence_expression_is_compliant(licence_expression: str, licence_list: list) -> bool:
250254 """Checks whether an expression is compliant with a list of licences."""
251255 licensing_util = Licensing()
252- for l in licence_list:
253- if licensing_util.contains(licence_expression, l ):
256+ for licence in licence_list:
257+ if licensing_util.contains(licence_expression, licence ):
254258 return True
255259 return False
256260
@@ -262,9 +266,9 @@ <h1 class="title">Module <code>mbed_tools_ci_scripts.utils.third_party_licences<
262266
263267def is_licence_accepted(licence_expression: str) -> bool:
264268 """Determines whether the licence expressed is valid with regards to project's accepted licences."""
265- authorised_licences = [l .identifier for l in get_allowed_opensource_licences()]
269+ authorised_licences = [licence .identifier for licence in get_allowed_opensource_licences()]
266270 is_or = _is_expression_or(licence_expression)
267- if bool([l for l in determine_licences_not_in_list(licence_expression, iter(authorised_licences))]):
271+ if bool([licence for licence in determine_licences_not_in_list(licence_expression, iter(authorised_licences))]):
268272 return (
269273 determine_whether_licence_expression_is_compliant(licence_expression, authorised_licences)
270274 if is_or
@@ -390,8 +394,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>
390394< pre > < code class ="python "> def determine_whether_licence_expression_is_compliant(licence_expression: str, licence_list: list) -> bool:
391395 """Checks whether an expression is compliant with a list of licences."""
392396 licensing_util = Licensing()
393- for l in licence_list:
394- if licensing_util.contains(licence_expression, l ):
397+ for licence in licence_list:
398+ if licensing_util.contains(licence_expression, licence ):
395399 return True
396400 return False</ code > </ pre >
397401</ details >
@@ -423,9 +427,9 @@ <h2 class="section-title" id="header-functions">Functions</h2>
423427</ summary >
424428< pre > < code class ="python "> def is_licence_accepted(licence_expression: str) -> bool:
425429 """Determines whether the licence expressed is valid with regards to project's accepted licences."""
426- authorised_licences = [l .identifier for l in get_allowed_opensource_licences()]
430+ authorised_licences = [licence .identifier for licence in get_allowed_opensource_licences()]
427431 is_or = _is_expression_or(licence_expression)
428- if bool([l for l in determine_licences_not_in_list(licence_expression, iter(authorised_licences))]):
432+ if bool([licence for licence in determine_licences_not_in_list(licence_expression, iter(authorised_licences))]):
429433 return (
430434 determine_whether_licence_expression_is_compliant(licence_expression, authorised_licences)
431435 if is_or
@@ -555,8 +559,12 @@ <h2 class="section-title" id="header-classes">Classes</h2>
555559 self.load()
556560 if not self._licence_store or not self._licence_list:
557561 return None
558- matching_licences = [l for l in self._licence_list if licence_descriptor_pattern.match(l)]
559- return [cast(Licence, self._licence_store.get(l)) for l in matching_licences] if matching_licences else None
562+ matching_licences = [licence for licence in self._licence_list if licence_descriptor_pattern.match(licence)]
563+ return (
564+ [cast(Licence, self._licence_store.get(licence)) for licence in matching_licences]
565+ if matching_licences
566+ else None
567+ )
560568
561569 def get_licence(self, licence_descriptor: Optional[str]) -> Optional[Licence]:
562570 """Determines the licence based on a string descriptor e.g. Apache 2."""
@@ -602,8 +610,12 @@ <h3>Methods</h3>
602610 self.load()
603611 if not self._licence_store or not self._licence_list:
604612 return None
605- matching_licences = [l for l in self._licence_list if licence_descriptor_pattern.match(l)]
606- return [cast(Licence, self._licence_store.get(l)) for l in matching_licences] if matching_licences else None</ code > </ pre >
613+ matching_licences = [licence for licence in self._licence_list if licence_descriptor_pattern.match(licence)]
614+ return (
615+ [cast(Licence, self._licence_store.get(licence)) for licence in matching_licences]
616+ if matching_licences
617+ else None
618+ )</ code > </ pre >
607619</ details >
608620</ dd >
609621< dt id ="mbed_tools_ci_scripts.utils.third_party_licences.OpenSourceLicences.load "> < code class ="name flex ">
0 commit comments