[WIP] Potential whole-file fix for file modification when commenting
Review Request #10219 — Created Oct. 11, 2018 and discarded
NOTE: Very WIP, posted mostly for feedback / discussion. The current
change is not ideal, and will be different.The Bug
According to the previous code "Some tools report general file errors as
being on line 0" It handles this special case by bumping up all
"first_line" arguments to 1. The_is_modified()
method will then check
if any of the diff chunks report line 1 is modified. This will cause
users who have "comment on modified files" disabled to not get any
comments on files which do not have the first line modified. This
problem is caused in part byis_modified()
only handling single lines
and ignoring itsnum_lines
parameter.The current patch adds a new
is_any_modified()
which is called instead
of any multiple-line checks in thecomment()
method whenfirst_line
is 0, which simply checks if any hunk is not 'equal'.
Currently testing on my
nyc
plugin
- Commit:
-
15ba6d8cda6611480c56e2458c8dbbc5cd9f3f4e69308138c3a239e7759cd3539d9184fba3af5696
Checks run (2 succeeded)
- Commit:
-
69308138c3a239e7759cd3539d9184fba3af5696d25a9c6ce75f0f6a1cfbbd9f4b87275dbbae9db8
- Diff:
-
Revision 3 (+5 -4)