(argv: Sequence[str] | None = None)
| 1049 | |
| 1050 | |
| 1051 | def main(argv: Sequence[str] | None = None) -> int: |
| 1052 | parser = argparse.ArgumentParser(description="DeepLabCut checks tool (docs + notebooks)") |
| 1053 | parser.add_argument("--config", default=str(DEFAULT_CFG), help="Path to YAML config file") |
| 1054 | parser.add_argument( |
| 1055 | "--no-step-summary", |
| 1056 | action="store_true", |
| 1057 | help="Do not write to GITHUB_STEP_SUMMARY", |
| 1058 | ) |
| 1059 | parser.add_argument("--out-dir", default=f"tmp/{OUTPUT_FILENAME}", help="Directory to write outputs") |
| 1060 | |
| 1061 | sub = parser.add_subparsers(dest="cmd", required=True) |
| 1062 | rep = sub.add_parser("report", help="Generate staleness report (read-only)") |
| 1063 | rep.add_argument( |
| 1064 | "--targets", |
| 1065 | nargs="*", |
| 1066 | help=( |
| 1067 | "Optional repo-relative targets to limit the operation. " |
| 1068 | "Supports exact files, directories, and glob patterns " |
| 1069 | "(e.g. docs/page.md, docs/gui/, 'docs/**/*.md'). " |
| 1070 | "Both '/' and '\\' are accepted." |
| 1071 | ), |
| 1072 | ) |
| 1073 | |
| 1074 | chk = sub.add_parser( |
| 1075 | "check", |
| 1076 | help=( |
| 1077 | "Run scans + policy checks (read-only). " |
| 1078 | "Fails on enforced policy violations; scan errors are non-fatal by default." |
| 1079 | ), |
| 1080 | ) |
| 1081 | chk.add_argument( |
| 1082 | "--targets", |
| 1083 | nargs="*", |
| 1084 | help=( |
| 1085 | "Optional list of relative file paths to scan (limits scan to these files). " |
| 1086 | "Supports exact files, directories, and glob patterns (e.g. docs/page.md, docs/gui/, 'docs/**/*.md'). " |
| 1087 | "Both '/' and '\\' are accepted." |
| 1088 | ), |
| 1089 | ) |
| 1090 | chk.add_argument( |
| 1091 | "--strict-mode", |
| 1092 | action="store_true", |
| 1093 | help="Enable failure on scan/parsing errors (overrides config for this run)", |
| 1094 | ) |
| 1095 | |
| 1096 | up = sub.add_parser("update", help="Update metadata/frontmatter (write mode requires --write)") |
| 1097 | up.add_argument( |
| 1098 | "--write", |
| 1099 | action="store_true", |
| 1100 | help="Actually write changes (otherwise dry-run)", |
| 1101 | ) |
| 1102 | up.add_argument( |
| 1103 | "--set-content-date-from-git", |
| 1104 | action="store_true", |
| 1105 | help="Set embedded last_content_updated from computed git content date", |
| 1106 | ) |
| 1107 | up.add_argument( |
| 1108 | "--targets", |
no test coverage detected