0

I use PySnooper library for debugging. It looks like this:

import pysnooper

@pysnooper.snoop()
def number_to_bits(number):
    ...

I don't want to commit such a code. This @pysnooper library is for debugging only. How to prevent it with pre-commit hooks?

Max Block
  • 1,134
  • 3
  • 16
  • 23
  • Questions asking fro software or library recommendations are off-topic here. That said, look into https://pre-commit.com, you can add your own checks and there's a bunch of pre-made checks for everything from ssh keys to file name case. – Robert Jun 27 '20 at 15:51

1 Answers1

1

https://github.com/adamchainz/flake8-tidy-imports#banned-modules This linter can do it.

[flake8]
banned-modules = pysnooper = remove debugging code!
Max Block
  • 1,134
  • 3
  • 16
  • 23