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

Function main

ci/lint_python/keyboard_interrupt_checker.py:296–323  ·  view source on GitHub ↗
(argv: list[str] | None = None)

Source from the content-addressed store, hash-verified

294
295
296def main(argv: list[str] | None = None) -> int:
297 parser = argparse.ArgumentParser(
298 description="Check Python files for proper KeyboardInterrupt handling.",
299 )
300 parser.add_argument(
301 "paths",
302 nargs="+",
303 help="Files or directories to check",
304 )
305 parser.add_argument(
306 "--exclude",
307 nargs="*",
308 default=[],
309 help="Substrings to exclude from file paths",
310 )
311 args = parser.parse_args(argv)
312
313 files = collect_python_files(args.paths, args.exclude)
314 candidates = find_candidates(files)
315
316 total_violations = 0
317 for path, source in candidates:
318 violations = check_file(str(path), source)
319 for v in violations:
320 print(f"{path}:{v.line}:{v.col}: {v}")
321 total_violations += 1
322
323 return 1 if total_violations > 0 else 0
324
325
326if __name__ == "__main__":

Callers 1

Calls 5

find_candidatesFunction · 0.85
parse_argsMethod · 0.80
collect_python_filesFunction · 0.70
check_fileFunction · 0.70
printFunction · 0.50

Tested by

no test coverage detected