[WIP] Potential whole-file fix for file modification when commenting

Review Request #10219 — Created Oct. 12, 2018 and discarded

alextechcc
ReviewBot
master
reviewbot, students

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 by is_modified() only handling single lines
and ignoring its num_lines parameter.

The current patch adds a new is_any_modified() which is called instead
of any multiple-line checks in the comment() method when first_line
is 0, which simply checks if any hunk is not 'equal'.

Currently testing on my nyc plugin

  • 0
  • 0
  • 3
  • 0
  • 3
Description From Last Updated
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

alextechcc
brennie
  1. 
      
  2. bot/reviewbot/processing/review.py (Diff revision 1)
     
     

    We should also accept None for this.

  3. bot/reviewbot/processing/review.py (Diff revision 1)
     
     

    This should be None.
    num_lines shoould also be None.

  4. 
      
alextechcc
alextechcc
Review request changed

Status: Discarded

Change Summary:

No longer about general comments, opening new review request

Loading...