Apply basic colorization to diff

Review Request #11829 — Created Oct. 3, 2021 and updated — Latest diff uploaded

Information

RBTools
master

Reviewers

Add an option to the rbt diff command to
apply basic colorization to the output.
The rbt diff --color-diff command highlights
removed lines in red and added lines in green.

This review request includes the following:

  • Utilizing pygments library, format the diff displayed
    on terminal with basic colorization.
  • Add --color-diff option to rbt diff command.

Project documentation and notes

  • Created test_diff.py that contains test cases for rbt diff command
  • Tested command arguments and formating the diff using pygments library.

Diff Revision 12

This is not the most recent revision of the diff. The latest diff is revision 20. See what's changed.

orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Commits

First Last Summary ID Author
Apply basic colorization to diff
622bd97c692a5d19caae495823376b8cd233c6c5 Sandy Saji
clean up
b77a7aec6879e99921707ca3539374b6175e34d6 Sandy Saji
Update code to meet PEP8 coding standards
c0515acf1111028bfc17ee798e843acf18ded18c Sandy Saji
Update code to meet PEP8 coding standards
5bcb68b609c9a7eb1dce1c6c1a9015579fb117d6 Sandy Saji
Update code to meet PEP8 coding standards
a787bc38006b09645758ea678caa37d80ce3e35d Sandy Saji
Updated if-else statement with elif
9ac91d774f655263e4ac081b24880a3450cb835e Sandy Saji
clean up file
2ebb07e3c1b77b3e84adb80a28375658bb517d49 Sandy Saji
Inital test for rbt diff command
cc1d683c47620bf3f460096270db103d26300905 Sandy Saji
fix flake8 error and minor update to test file
b4387fbb996be884259c7615a411ac04e16bb349 Sandy Saji
Update color option to utilize choices instead of boolean
b6e2af6fa0633639e3c68e431f4de3416218df00 Sandy Saji
remove print statements
318d2b98f4f5e5a9f3e89e40a1526f5ba310e613 Sandy Saji
fix flake8 errors
a16745ed2856170647bcfc0a5d5e9e159cc5b5e8 Sandy Saji
fix flake8 errors
87ad76ef3a2c938a42493ab1003857e4b52e92ba Sandy Saji
update diff color function to return highlighted diff and clean up file
2f3d0bac30dedb4c74b199f36d5ab1c8f4e8888f Sandy Saji
add test cases and clean up file
c4d389ccc9d5a052011649d5972a9d9c7cd72c67 Sandy Saji
clean up code to meeting coding standards
8c35cf1a6eb99524fa3f9eac2dadd14d5ccce6da Sandy Saji
clean up test file to meeting coding standards
af1ca798e79c3a559fc8c6c06e015aa8d07fd113 Sandy Saji
fix flake8 errors
798b06c140af403c0e280ebcdcc0f2ac7fccf5f6 Sandy Saji
documented code and addressd feedbacks
00eb30d61779430441ea66adc7b591c96ff8ee2b Sandy Saji
rbtools/commands/diff.py
rbtools/commands/tests/test_diff.py
Loading...