def parse()

in probe_scraper/parsers/tags.py [0:0]


    def parse(self, filenames, config, repo_url=None, commit_hash=None):
        config = config.copy()
        paths = [Path(fname) for fname in filenames]
        paths = [path for path in paths if path.is_file()]
        results = parse_objects(paths, config)
        errors = [err for err in results]
        tags = {
            tag_name: tag_data.serialize()
            for tag_name, tag_data in results.value.get("tags", {}).items()
        }

        for v in tags.values():
            if repo_url and commit_hash:
                v["source_url"] = get_source_url(v["defined_in"], repo_url, commit_hash)
            # the 'defined_in' structure is no longer needed
            del v["defined_in"]
        return tags, errors