flake8
-
python/pydiffx/utils/unified_diffs.py (Diff revision 1) Show all issues
Review Request #11740 — Created July 21, 2021 and submitted
Information | |
---|---|
chipx86 | |
DiffX | |
master | |
Reviewers | |
diffx | |
This introduces
pydiffx.utils.unified_diffs
, which contains a
get_unified_diff_hunks
method. This method iterates through a byte
string, returning a list of information on each hunk found in the
string, up until either the end of the string or the first occurrence of
something other thna a hunk.The following general information is returned:
For each hunk:
@@ ... @@
).For each side (original/modified) of each hunk:
This can be told to ignore junk between headers, which is helpful for
gathering stats across an entire diff file.
It will raise a MalformedHunkError
if it finds anything really out of
the ordinary (such as a premature end of a hunk, or garbage found within
the hunk).
This method is based on a similar method we have in Review Board, but
with some improvements to parsing, strictness, and results. It will be
used by the DiffX
DOM class in an upcoming change to calculate stats
for the generated DiffX file.
Unit tests pass on Python 2 and 3.
Built the docs and checked that they rendered and linked correctly.
Checked for spelling errors.
Summary | |
---|---|
Description | From | Last Updated |
---|---|---|
E501 line too long (80 > 79 characters) |
![]() |