def METHOD_NAME(self) -> None:
    packages: PackageMessages = {}
    fatal_msgs: list[Message] = []
    package_data_iter = (
        self.packages.items()
        if self.config.batches is None
        else list(self.packages.items())[
            self.config.batchIdx :: self.config.batches
        ]
    )
    for package, data in package_data_iter:
        messages, p_fatal_msgs = self._lint_package(package, data)
        fatal_msgs += p_fatal_msgs
        local_commit = Repo(data.clone_directory).head.object.hexsha
        packages[package] = PackageData(commit=local_commit, messages=messages)
    path = self.primer_directory / (
        f"output_{'.'.join(str(i) for i in sys.version_info[:3])}_{self.config.type}"
        + (f"_batch{self.config.batchIdx}.txt" if self.config.batches else "")
    )
    print(f"Writing result in {path}")
    with open(path, "w", encoding="utf-8") as f:
        json.dump(packages, f)
    # Assert that a PR run does not introduce new fatal errors
    if self.config.type == "pr":
        plural = "s" if len(fatal_msgs) > 1 else ""
        assert (
            not fatal_msgs
        ), f"We encountered {len(fatal_msgs)} fatal error message{plural} (see log)."