(violations: List[Violation])
return out
Returns count of violation per file, per check_id
Returns count of violation per file, per check_id
Returns count of violation per file per check_id
def __get_aggregate_violations(violations: List[Violation]) -> List[Dict[str, Any]]:
    """Returns count of violation per file, per check_id"""

    def grouping(v: Violation) -> Tuple[str, str]:
        return v.path, v.check_id

    out = []
    for k, v in itertools.groupby(sorted(violations, key=grouping), grouping):
        p, rid = k
        out.append(
            {
                "path_hash": __hash_sha256(p, RESULTS_SALT),
                "check_id": rid,
                "count": sum(1 for _ in v),
                "filtered_count": __get_filtered_violation_count(v),
            }
        )
    return out
def __get_aggregate_violations ( violations : List [ Violation ] ) -> List [ Dict [ str , Any ] ] : def grouping ( v : Violation ) -> Tuple [ str , str ] : return v . path , v . check_id out = [ ] for k , v in itertools . groupby ( sorted ( violations , key = grouping ) , grouping ) : p , rid = k out . append ( { "path_hash" : __hash_sha256 ( p , RESULTS_SALT ) , "check_id" : rid , "count" : sum ( 1 for _ in v ) , "filtered_count" : __get_filtered_violation_count ( v ) , } ) return out