def metadata_lint(old, new, locations):
<EOL>old = old.copy()<EOL>new = new.copy()<EOL>old.pop('<STR_LIT>', None)<EOL>new.pop('<STR_LIT>', None)<EOL>for old_group_name in old:<EOL><INDENT>if old_group_name not in new:<EOL><INDENT>yield LintError('<STR_LIT>', '<STR_LIT>', api_name=old_group_name)<EOL><DEDENT><DEDENT>for group_name, new_group in new.items():<EOL><INDENT>old_group = old.get(group_name, {'<STR_LIT>': {}})<EOL>for name, api in new_group['<STR_LIT>'].items():<EOL><INDENT>old_api = old_group['<STR_LIT>'].get(name, {})<EOL>api_locations = locations[name]<EOL>for message in lint_api(name, old_api, api, api_locations):<EOL><INDENT>message.api_name = name<EOL>if message.location is None:<EOL><INDENT>message.location = api_locations['<STR_LIT>']<EOL><DEDENT>yield message<EOL><DEDENT><DEDENT><DEDENT>
Run the linter over the new metadata, comparing to the old.