From 698a28c197fd3005cf2f1597fa8d61c2cd841532 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 04:24:34 +0000 Subject: [PATCH 1/3] Initial plan From 23abb8452d741ec69e025f96e2a50ef343104ec3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 04:29:13 +0000 Subject: [PATCH 2/3] Add CI check for help output consistency Co-authored-by: dwilding <1141260+dwilding@users.noreply.github.com> --- .github/workflows/checks.yaml | 2 + scripts/check_help_consistency.py | 86 +++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100755 scripts/check_help_consistency.py diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 6dcd7aa..87dbf57 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -23,3 +23,5 @@ jobs: run: uvx --from rust-just just lint - name: Run unit tests run: uvx --from rust-just just test-unit + - name: Check help consistency + run: python3 scripts/check_help_consistency.py diff --git a/scripts/check_help_consistency.py b/scripts/check_help_consistency.py new file mode 100755 index 0000000..fdd0a60 --- /dev/null +++ b/scripts/check_help_consistency.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +"""Check that the help output in README.md matches the output of 'uv run gimmegit -h'.""" + +import subprocess +import sys +from pathlib import Path + + +def extract_help_from_readme(readme_path: Path) -> str: + """Extract help text from README.md between the Command reference markers.""" + content = readme_path.read_text() + + # Find the start marker + start_marker = "# Command reference\n\n```text\n" + start_idx = content.find(start_marker) + if start_idx == -1: + print("Error: Could not find '# Command reference' marker in README.md") + sys.exit(1) + + # Start after the marker + start_idx += len(start_marker) + + # Find the closing triple backtick + end_idx = content.find("\n```", start_idx) + if end_idx == -1: + print("Error: Could not find closing triple backtick after Command reference") + sys.exit(1) + + # Extract the text between markers + help_text = content[start_idx:end_idx] + return help_text + + +def get_actual_help_output() -> str: + """Get the actual help output from running 'uv run gimmegit -h'.""" + try: + result = subprocess.run( + ["uv", "run", "gimmegit", "-h"], + capture_output=True, + text=True, + check=True, + ) + return result.stdout.rstrip() + except subprocess.CalledProcessError as e: + print(f"Error running 'uv run gimmegit -h': {e}") + print(f"stdout: {e.stdout}") + print(f"stderr: {e.stderr}") + sys.exit(1) + + +def main(): + """Main function to check help consistency.""" + repo_root = Path(__file__).parent.parent + readme_path = repo_root / "README.md" + + if not readme_path.exists(): + print(f"Error: README.md not found at {readme_path}") + sys.exit(1) + + # Extract help from README + readme_help = extract_help_from_readme(readme_path) + + # Get actual help output + actual_help = get_actual_help_output() + + # Compare + if readme_help == actual_help: + print("✓ Help output in README.md matches 'uv run gimmegit -h'") + sys.exit(0) + else: + print("✗ Help output in README.md does NOT match 'uv run gimmegit -h'") + print() + print("Expected (from 'uv run gimmegit -h'):") + print("=" * 80) + print(actual_help) + print("=" * 80) + print() + print("Found in README.md:") + print("=" * 80) + print(readme_help) + print("=" * 80) + sys.exit(1) + + +if __name__ == "__main__": + main() From 62c21476063a23fb02be63ce4adc2f8f2bd1ce2e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 04:30:51 +0000 Subject: [PATCH 3/3] Address code review feedback Co-authored-by: dwilding <1141260+dwilding@users.noreply.github.com> --- .github/workflows/checks.yaml | 2 +- scripts/check_help_consistency.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 87dbf57..7d39094 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -24,4 +24,4 @@ jobs: - name: Run unit tests run: uvx --from rust-just just test-unit - name: Check help consistency - run: python3 scripts/check_help_consistency.py + run: uv run python scripts/check_help_consistency.py diff --git a/scripts/check_help_consistency.py b/scripts/check_help_consistency.py index fdd0a60..f5f0f1e 100755 --- a/scripts/check_help_consistency.py +++ b/scripts/check_help_consistency.py @@ -40,7 +40,7 @@ def get_actual_help_output() -> str: text=True, check=True, ) - return result.stdout.rstrip() + return result.stdout.rstrip('\n') except subprocess.CalledProcessError as e: print(f"Error running 'uv run gimmegit -h': {e}") print(f"stdout: {e.stdout}")