Description 📝
In PRReviewSystem.process_pull_request(), the variable results is passed to
_send_discord_notification() before it is defined. This may raise an
UnboundLocalError when this code path is executed.
Link 🔗
https://github.com/ruxailab/disgitbot/blob/main/pr_review/main.py
Steps to Reproduce 🔄
- Trigger the PR review automation for a pull request.
- Execution reaches the Discord notification step.
results is referenced before being assigned.
Screenshots 📸
Not applicable (code-level issue).
Expected Behavior 🤔
The results object should be defined before being passed to
_send_discord_notification() so that the notification can be sent safely.
Actual Behavior 😱
The code references the results variable before it is assigned, which can
raise an UnboundLocalError at runtime.
Environment 🌍
- Project file:
pr_review/main.py
- Git branch:
main
- OS: Windows
Additional Information ℹ️
Happy to open a PR with a fix if this change is acceptable.