Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor telescope, hexdump, and enhance to use ColorConfig #1324

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

gsingh93
Copy link
Member

@gsingh93 gsingh93 commented Oct 23, 2022

@disconnect3d there are a few config options that didn't properly follow the naming convention between the parameter name and the function name. I've made these consistent:

  • separator -> offset-separator
  • offset -> offset-delimiter
  • integer -> integer-value
  • integer -> string-value

Also, hexdump-highlight-group-lsb was essentially a color parameter but was not named like one. The name sounds like it's a boolean, but you can customize how you want the lsb to be colored (the default is "underline"), so I renamed it to hexdump-lsb-color.

With these renamings, how do we not break existing themes? I'd like to display a message if anyone is explicitly setting a deprecated paramater.

Maybe something like DeprecatedParameter('hexdump-highlight-group-lsb', 'hexdump-lsb-color'), which would detect when someone tries to access the old name for the first time, print a deprecation warning, and then re-map it to the correct config name. Then we can remove the old config in the future.

@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2022

Codecov Report

Merging #1324 (ed7292e) into dev (3d10dce) will decrease coverage by 0.10%.
The diff coverage is 93.10%.

@@            Coverage Diff             @@
##              dev    #1324      +/-   ##
==========================================
- Coverage   54.97%   54.86%   -0.11%     
==========================================
  Files         153      150       -3     
  Lines       19381    19332      -49     
  Branches     1811     1811              
==========================================
- Hits        10654    10606      -48     
+ Misses       8277     8276       -1     
  Partials      450      450              
Impacted Files Coverage Δ
pwndbg/enhance.py 83.13% <81.81%> (+0.41%) ⬆️
pwndbg/color/__init__.py 81.65% <100.00%> (+0.34%) ⬆️
pwndbg/commands/hexdump.py 69.69% <100.00%> (+4.17%) ⬆️
pwndbg/commands/telescope.py 83.83% <100.00%> (+0.33%) ⬆️
pwndbg/hexdump.py 91.37% <100.00%> (-0.43%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants