""" Parses compiler output with -fdiagnostics-format=json and checks that warnings exist only in files that are expected to have warnings. """ import argparse from collections import defaultdict import json import re import sys from pathlib import Path from typing import NamedTuple class FileWarnings(NamedTuple): name: str count: int def extract_warnings_from_compiler_output_clang( compiler_output: str, ) -> list[dict]: """ Extracts warnings from the compiler output when using clang """ # Regex to find warnings in the compiler output clang_warning_regex = re.compile( r"(?P.*):(?P\d+):(?P\d+): warning: " r"(?P.*) (?P