Detect and handle collapsible minified file diffs
Review Request #10162 — Created Sept. 22, 2018 and updated — Latest diff uploaded
Implementation of diff file name extension checking for
.min
and content
checking for a small number of long lines in a file. If either is true then
it is likely a minified file. The minified file is then collapsed similarly
to deleted files and can be expanded to show the content of the file.In
diffviewer/diffutils.py
,get_diff_files()
performs the file extension
check then inpopulate_diff_chunks()
if the file didn't have a.min
extension the content check is performed.If the file was previously marked as a min by it's extension and if it has
less than 20 lines total then the lines are length checked to be greater
than 500 characters and if true remarked as minified files.The
diff_file_fragment.html
then replaces then diff content with a minified
file message and a show content button that with a event listener in
diffReviewableModel.es6.js
anddiffViewerPageView.es6.js
loads in the
minified file contents to the fragment.
test_diffutils.py
python test written for testing minification testing.
test_minified_file_detection
creates a minified diff object and verifies
thediffutils.py
populate_diff_chunks()
minification content check.Ran Python Unit Tests.
Ran Javascript Jasmine Unit Tests.