Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions repology/parsers/parsers/nix.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ def iter_parse(self, path: str, factory: PackageFactory) -> Iterable[PackageMake
else:
pkg.add_maintainers(extract_nix_maintainers(meta['maintainers']))

if 'teams' in meta:
if not isinstance(meta['teams'], list):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need data format checks, it should just fail on unexpected data. So this may probably be simplified to

for team in meta.get('teams', []):
    pkg.add_maintainers(extract_nix_maintainers(team['members']))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

pkg.log('teams "{}" is not a list'.format(meta['teams']), severity=Logger.ERROR)
else:
for item in meta['teams']:
pkg.add_maintainers(extract_nix_maintainers(item['members']))

if 'license' in meta:
pkg.add_licenses(extract_nix_licenses(meta['license']))

Expand Down