There isn’t a way in flake8 to ignore a block of code
Your options are:
-
ignore each line that produces an error by putting
# noqa: E501on it -
ignore the entire file (but this turns off all other errors as well) with a
# flake8: noqaon a line by itself -
ignore
E501in the entire file by usingper-file-ignores:[flake8] per-file-ignores = path/to/file.py: E501
generally I’d prefer the third one, maybe even sequestering your long-strings into their own file to be ignored
disclaimer: I’m the current flake8 maintainer