Skip to content

Commit

Permalink
rename main.py to pearbot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rbx committed Oct 13, 2024
1 parent 52e4883 commit 169ba71
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ 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
GITHUB_APP_WEBHOOK_SECRET: dummy_secret

- 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
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
```
2 changes: 1 addition & 1 deletion src/main.py → src/pearbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 169ba71

Please sign in to comment.