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

Function run_checkers_on_single_file

ci/lint_cpp/run_all_checkers.py:802–839  ·  view source on GitHub ↗

Run all applicable checkers on a single file. Args: file_path: Absolute path to the file to check checkers_by_scope: Dictionary of checkers organized by scope Returns: Dictionary mapping checker class name to CheckerResults

(
    file_path: str, checkers_by_scope: dict[str, list[FileContentChecker]]
)

Source from the content-addressed store, hash-verified

800
801
802def run_checkers_on_single_file(
803 file_path: str, checkers_by_scope: dict[str, list[FileContentChecker]]
804) -> dict[str, CheckerResults]:
805 """Run all applicable checkers on a single file.
806
807 Args:
808 file_path: Absolute path to the file to check
809 checkers_by_scope: Dictionary of checkers organized by scope
810
811 Returns:
812 Dictionary mapping checker class name to CheckerResults
813 """
814 processor = MultiCheckerFileProcessor()
815 normalized_path = str(Path(file_path).resolve())
816
817 # Determine which scopes apply to this file
818 applicable_scopes = _determine_file_scopes(normalized_path)
819
820 # Collect all checkers for the applicable scopes
821 applicable_checkers: list[FileContentChecker] = []
822 for scope in applicable_scopes:
823 applicable_checkers.extend(checkers_by_scope.get(scope, []))
824
825 # Remove duplicate checkers (same instance may be added from multiple scopes)
826 seen_checkers: set[int] = set()
827 unique_checkers: list[FileContentChecker] = []
828 for checker in applicable_checkers:
829 checker_id = id(checker)
830 if checker_id not in seen_checkers:
831 seen_checkers.add(checker_id)
832 unique_checkers.append(checker)
833
834 # Run all applicable checkers on this single file
835 if unique_checkers:
836 processor.process_files_with_checkers([normalized_path], unique_checkers)
837 return _collect_violations_from_checkers(unique_checkers)
838
839 return {}
840
841
842def main() -> int:

Callers 1

mainFunction · 0.85

Calls 10

_determine_file_scopesFunction · 0.85
idClass · 0.85
setClass · 0.50
resolveMethod · 0.45
getMethod · 0.45
addMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected