MCPcopy Create free account
hub / github.com/FastLED/FastLED / _collect_violations_from_checkers

Function _collect_violations_from_checkers

ci/lint_cpp/run_all_checkers.py:678–710  ·  view source on GitHub ↗

Collect violations from a list of checkers. Args: checkers: List of checker instances to collect violations from Returns: Dictionary mapping checker class name to CheckerResults

(
    checkers: list[FileContentChecker],
)

Source from the content-addressed store, hash-verified

676
677
678def _collect_violations_from_checkers(
679 checkers: list[FileContentChecker],
680) -> dict[str, CheckerResults]:
681 """Collect violations from a list of checkers.
682
683 Args:
684 checkers: List of checker instances to collect violations from
685
686 Returns:
687 Dictionary mapping checker class name to CheckerResults
688 """
689 all_results: dict[str, CheckerResults] = {}
690
691 for checker in checkers:
692 checker_name = checker.__class__.__name__
693 violations = getattr(checker, "violations", None)
694 if not violations:
695 continue
696
697 results = _convert_violations_to_results(violations)
698
699 # Merge violations from multiple checkers with same name
700 if checker_name not in all_results:
701 all_results[checker_name] = results
702 else:
703 # Merge into existing results
704 for file_path, file_violations in results.violations.items():
705 for violation in file_violations.violations:
706 all_results[checker_name].add_violation(
707 file_path, violation.line_number, violation.content
708 )
709
710 return all_results
711
712
713def _determine_file_scopes(file_path: str) -> set[str]:

Callers 2

run_checkersFunction · 0.85

Calls 3

itemsMethod · 0.80
add_violationMethod · 0.45

Tested by

no test coverage detected