From 169ba7182ad8c38845d3d9ec1d34189012c4c605 Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Sun, 13 Oct 2024 09:54:00 +0200 Subject: [PATCH] rename main.py to pearbot.py --- .github/workflows/ci.yml | 6 +++--- README.md | 8 ++++---- src/{main.py => pearbot.py} | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) rename src/{main.py => pearbot.py} (99%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1d0bef..c75ffb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,8 +29,8 @@ jobs: - name: Test app startup run: | - python -c "from src import main; print('Main module imported successfully')" - python -m src.main --help + python -c "from src import pearbot; print('pearbot module imported successfully')" + python -m src.pearbot --help env: GITHUB_APP_ID: dummy_id GITHUB_PRIVATE_KEY: dummy_key @@ -38,7 +38,7 @@ jobs: - name: Test server startup run: | - timeout 5s python -m src.main --server || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi + timeout 5s python -m src.pearbot --server || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi env: GITHUB_APP_ID: dummy_id GITHUB_PRIVATE_KEY: dummy_key diff --git a/README.md b/README.md index a676414..2616ea7 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Pearbot is an AI assistant that reviews Pull Requests on GitHub and/or local dif 2. Run the Pearbot server: ``` - python main.py --server + python pearbot.py --server ``` 3. The server will now listen for GitHub webhook events and automatically review Pull Requests when it encounters `@pearbot review` in a comment. @@ -56,16 +56,16 @@ Pearbot is an AI assistant that reviews Pull Requests on GitHub and/or local dif To analyze a local diff file: ``` -python main.py --diff path/to/your/diff/file +python pearbot.py --diff path/to/your/diff/file ``` Or pipe a diff directly: ``` -git diff | python main.py +git diff | python pearbot.py ``` You can generate diffs that include commit messages, e.g.: ``` -git format-patch HEAD~3..HEAD --stdout +git format-patch HEAD~3..HEAD --stdout | python pearbot.py ``` diff --git a/src/main.py b/src/pearbot.py similarity index 99% rename from src/main.py rename to src/pearbot.py index f1a7d4f..9d7afa3 100644 --- a/src/main.py +++ b/src/pearbot.py @@ -177,7 +177,7 @@ def analyze_diff(diff_content): print(f"\n\nImproved feedback:\n{improved_feedback}\n\n") def main(): - parser = argparse.ArgumentParser(description="Code Review Script") + parser = argparse.ArgumentParser(description="Pearbot Code Review") parser.add_argument("--server", action="store_true", help="Run as a server") parser.add_argument("--diff", type=str, nargs='?', const='-', help="Path to the diff file or '-' for stdin") parser.add_argument("--model", type=str, default="llama3.1", help="Model for the final review step")