Skip to content

Commit

Permalink
Cleaner.
Browse files Browse the repository at this point in the history
Signed-off-by: Harvey Tuch <[email protected]>
  • Loading branch information
htuch committed Oct 1, 2020
1 parent 49791ec commit 71a9c7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/dependency/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ def ValidateExtensionDeps(self, name, target):
metadata = self._dep_info.GetMetadata(d)
if metadata:
use_category = metadata['use_category']
valid_use_category = ('dataplane_ext' in use_category or
'observability_ext' in use_category or 'other' in use_category)
valid_use_category = any(
c in use_category for c in ['dataplane_ext', 'observability_ext', 'other'])

This comment has been minimized.

Copy link
@phlax

phlax Oct 1, 2020

Member

you could use set.intersection - ie set(['dataplane_ext', 'obser..']).intersection(use_category)

This comment has been minimized.

Copy link
@htuch

htuch Oct 1, 2020

Author Member

Yes, I thought about it, but I don't see it being a lot shorter or more efficient.

This comment has been minimized.

Copy link
@phlax

phlax Oct 1, 2020

Member

my thought is more readable

This comment has been minimized.

Copy link
@phlax

phlax Oct 1, 2020

Member

imho 8/

if not valid_use_category:
raise DependencyError(
f'Extensions {name} depends on {d} with "use_category" not including '
Expand Down

0 comments on commit 71a9c7f

Please sign in to comment.