0

I'm trying to clean flake8 errors from my code, and I have an ipdb import which should stay there.

I tried:

  import ipdb  # noqa: F811
  import ipdb  # NOQA 
  import ipdb  # noqa 

But all give the same error: - ipdb imported

How can I make it go away? (I don't want to ignore it entirely, as I don't want any other ipdb imports in the code, only to allow this one)

EDIT: I may have been wrong. I now suspect this is not Flake8 related, but debug-statements pre-commit hook related.

CIsForCookies
  • 12,097
  • 11
  • 59
  • 124

1 Answers1

1

yeah that's output from debug-statements, it intentionally has no way to disable it's behavior as the intention is to prevent checking in debug statements

that said, you can trick it:

ipdb = __import__('ipdb')

disclaimer: I'm the author of pre-commit and pre-commit-hooks (and the debug-statements hook there) and the maintainer of flake8

anthony sottile
  • 61,815
  • 15
  • 148
  • 207