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

Viewed 4252

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.

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.

Related