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.
Description π
In
PRReviewSystem.process_pull_request(), the variableresultsis passed to_send_discord_notification()before it is defined. This may raise anUnboundLocalErrorwhen this code path is executed.Link π
https://github.com/ruxailab/disgitbot/blob/main/pr_review/main.py
Steps to Reproduce π
resultsis referenced before being assigned.Screenshots πΈ
Not applicable (code-level issue).
Expected Behavior π€
The
resultsobject should be defined before being passed to_send_discord_notification()so that the notification can be sent safely.Actual Behavior π±
The code references the
resultsvariable before it is assigned, which canraise an
UnboundLocalErrorat runtime.Environment π
pr_review/main.pymainAdditional Information βΉοΈ
Happy to open a PR with a fix if this change is acceptable.