mdmintz / pdbp

pdbp (Pdb+): A drop-in replacement for pdb and pdbpp. To replace "pdb", add "import pdbp" to an "__init__.py" file.
Other
69 stars 2 forks source link

[feature] print less path #62

Closed holmanb closed 3 months ago

holmanb commented 3 months ago

Default behavior is to print the full path to a source file, but this adds unnecessary information in most cases. I know that this is default behavior that is expected from pdb / pdbpp, but I'd love to be able to set a configuration to have pdbp find the root of the project and, if found, only report the path under root directory of a project.

From the picture on the main page I want to see:

> SeleniumBase/examples/test_mfa_login.py(9)

Maybe this would even be a reasonable default? Increasing signal to noise ratio when debugging always seems helpful to me.

mdmintz commented 3 months ago

Not sure if there's a good way to determine the path to the root of the project directory, especially since you could have project directories inside of other project directories.

If regular pdb had an option for this, I could probably include it. But since that full path is the current default behavior of regular pdb, I probably wouldn't want to change that behavior in pdbp.

mdmintz commented 3 months ago

However, replacing the HOME DIR with ~ is easy to do, if that's good enough:

Screenshot 2024-06-28 at 5 29 00 PM
mdmintz commented 3 months ago

This was resolved in 1.5.1 - https://github.com/mdmintz/pdbp/releases/tag/v1.5.1

(The $HOME directory in the path gets replaced with a ~)