MCPcopy
hub / github.com/pandas-dev/pandas / print_validate_all_results

Function print_validate_all_results

scripts/validate_docstrings.py:357–396  ·  view source on GitHub ↗
(
    output_format: str,
    prefix: str | None,
    ignore_deprecated: bool,
    ignore_errors: dict[str, set[str]],
)

Source from the content-addressed store, hash-verified

355
356
357def print_validate_all_results(
358 output_format: str,
359 prefix: str | None,
360 ignore_deprecated: bool,
361 ignore_errors: dict[str, set[str]],
362):
363 if output_format not in ("default", "json", "actions"):
364 raise ValueError(f'Unknown output_format "{output_format}"')
365 if ignore_errors is None:
366 ignore_errors = {}
367
368 result = validate_all(prefix, ignore_deprecated)
369
370 if output_format == "json":
371 sys.stdout.write(json.dumps(result))
372 return 0
373
374 prefix = "##[error]" if output_format == "actions" else ""
375 exit_status = 0
376 for func_name, res in result.items():
377 error_messages = dict(res["errors"])
378 actual_failures = set(error_messages)
379 expected_failures = ignore_errors.get(func_name, set()) | ignore_errors.get(
380 None, set()
381 )
382 for err_code in actual_failures - expected_failures:
383 sys.stdout.write(
384 f"{prefix}{res['file']}:{res['file_line']}:"
385 f"{err_code}:{func_name}:{error_messages[err_code]}\n"
386 )
387 exit_status += 1
388 for err_code in ignore_errors.get(func_name, set()) - actual_failures:
389 sys.stdout.write(
390 f"{prefix}{res['file']}:{res['file_line']}:"
391 f"{err_code}:{func_name}:"
392 "EXPECTED TO FAIL, BUT NOT FAILING\n"
393 )
394 exit_status += 1
395
396 return exit_status
397
398
399def print_validate_one_results(

Callers 1

mainFunction · 0.85

Calls 4

validate_allFunction · 0.85
writeMethod · 0.45
itemsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected