When opening a PR without any changes (with one or more empty commits), clang-tidy-review currently fails with
Traceback (most recent call last):
File "/usr/local/bin/review", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.12/dist-packages/clang_tidy_review/review.py", line 154, in main
review = create_review(
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/clang_tidy_review/__init__.py", line 843, in create_review
diff = pull_request.get_pr_diff()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/clang_tidy_review/__init__.py", line 297, in get_pr_diff
diffs = data["data"]
~~~~^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
This PR checks data and returns with no changes.
While doing that, I noticed the return-type being wrong in this method, so I fixed that too.
When opening a PR without any changes (with one or more empty commits),
clang-tidy-review
currently fails withThis PR checks
data
and returns with no changes.While doing that, I noticed the return-type being wrong in this method, so I fixed that too.