Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github-auto-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
assignees: wachawo
reviewers: wachawo
reviewers: wachawo, KPbICO6Ou
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ repos:
entry: mypy
language: system
types: [python]
# args: ["--exclude=^tests/"]

- id: pytest
name: pytest
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ pre-commit install
pre-commit install --hook-type pre-push
pre-commit run --all-files
```

```bash
pytest --cov=src --cov-report=term-missing --cov-report=xml
coverage report
```
4 changes: 3 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[mypy]
strict = True
warn_unused_ignores = False
# exclude = test_main.py

[mypy-tests.*]
ignore_errors = True
5 changes: 4 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,15 @@ def main() -> int:
if reviewers:
# You cannot request a review from the PR author; filter to avoid API errors
author = payload["pull_request"].get("user", {}).get("login")
logger.info(f"PR author: {author}, requested reviewers: {reviewers}")
filtered = [r for r in reviewers if r != author]
if filtered:
logger.info(f"Requesting reviewers for PR #{number}: {filtered}")
pr.create_review_request(reviewers=filtered)
else:
logger.info("All reviewers matched the author; nothing to request")
logger.info(
f"All reviewers matched the PR author ({author}); cannot request review from yourself"
)
else:
logger.info("No reviewers provided; skipping")
return 0
Expand Down
Loading