Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore flake8 "line too long" errors in a heredoc

Tags:

python

flake8

Suppose I have a file with a heredoc with long lines:

    some_string = '''
very long lines here, 20 lines each of length 500
'''

How do I ignore all the flake8 "line too long" errors in that heredoc, without excluding the entire file from checking?

This answer describes # noqa for a single line, but I can't put that in the heredoc. The manual does not seem to describe ignoring a chunk of code.

like image 260
dfrankow Avatar asked Dec 28 '25 20:12

dfrankow


1 Answers

Oh oops, I found the answer. I can put # noqa at the end of the heredoc:

    some_string = '''
very long lines here, 20 lines each of length 500
'''  # noqa

I feel silly.

like image 55
dfrankow Avatar answered Dec 30 '25 08:12

dfrankow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!