ionelmc / python-hunter

Hunter is a flexible code tracing toolkit.
https://python-hunter.readthedocs.io/
BSD 2-Clause "Simplified" License
800 stars 47 forks source link

Predefined trace configurations #29

Open ionelmc opened 8 years ago

ionelmc commented 8 years ago

Have a set of predefined configurations + actions for common situations like:

kawing-chiu commented 6 years ago

I think it would be great if we can have some configuration files (at both user and project level) to specify hunter configuration for the user/project, in addition to those specified in runtime (like flake8 's configuration structure).

For example, I have some common libs like numpy, pandas, matplotlib pre-loaded in ipython's config. So almost always I would like to exclude those, plus the libs that ipython itself uses. This leads to something like:

h.trace(~Q(kind='line'),
    ~Q(module_in=['six', 'pkg_resources', 'autoreload']),
    ~Q(module_startswith=['IPython', 'prompt_toolkit', 'traitlets', 'wcwidth',
        'matplotlib', 'pygments', 'numpy', 'fields',
        'hunter', 'colorama', 'scipy']),
    ~Q(filename=''), stdlib=False)

to be typed for every session.

abitrolly commented 3 years ago

I need to ignore everything installed in my virtualenv except for my project files.