()
| 175 | |
| 176 | |
| 177 | def main() -> None: |
| 178 | parser: Final = argparse.ArgumentParser(description=__doc__) |
| 179 | parser.add_argument("--base", help="Comparison ref (default: origin's current default branch)") |
| 180 | parser.add_argument( |
| 181 | "--emit-counts-dir", |
| 182 | type=Path, |
| 183 | help="Write HEAD's per-rule counts to this directory as a base-counts artifact instead of gating", |
| 184 | ) |
| 185 | args: Final = parser.parse_args() |
| 186 | from default_branch import resolve_base_ref |
| 187 | from gate_slot_lock import held_slot |
| 188 | |
| 189 | if args.emit_counts_dir is not None: |
| 190 | with held_slot(): |
| 191 | emit_counts(checker_identity(), count_by_rule(head_violations()), args.emit_counts_dir, head_sha()) |
| 192 | return |
| 193 | base_ref: Final = resolve_base_ref(args.base, REPO_ROOT) |
| 194 | with held_slot(): |
| 195 | cmd_check(base_ref) |
| 196 | |
| 197 | |
| 198 | if __name__ == "__main__": |
no test coverage detected