jendrikseipp / vulture

Find dead Python code
MIT License
3.48k stars 152 forks source link

Should add support for pycharm / jetbrain statements. #251

Closed jimmy927 closed 2 years ago

jimmy927 commented 3 years ago

Example:

# noinspection PyUnusedLocal
def terminate_process(signal_number, frame):
    print("signal Received: %s", signal.Signals(signal_number).name)
    raise SystemExit
RJ722 commented 3 years ago

@jimmy927 Can you elaborate some more on this -- What is the outcome you want to achieve? How are you using Vulture with PyCharm/JetBrains? And how is the code snipped above relevant to it?

nmenardg-keeper commented 2 years ago

PyCharm has a builtin linter with a syntax for disabling warnings. It works with these # noinspection comments disabling inspection. In this particular case I think this comment suppresses warnings for unused local variables in the terminate_process function

I believe OP would like to be able to disable both the PyCharm linter and vulture using the same syntax.

jendrikseipp commented 2 years ago

I think in this case it's cleaner to add del frame at the top of the function to let Vulture ignore the unused variable (see Vulture README.md file).