summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorGreg Ward <greg@gerg.ca>2013-11-08 16:09:49 -0500
committerGreg Ward <greg@gerg.ca>2013-11-08 16:21:56 -0500
commit8b734d96aaefa8c054a738fa61c8e5159e7e8953 (patch)
treef27b0ce2df23a9c8ac7ee154d9471c0571e99e2e /testsuite
parent5d24e16b633904135f42fbba2a4bc390e5d15a85 (diff)
downloadpep8-8b734d96aaefa8c054a738fa61c8e5159e7e8953.tar.gz
Optionally disable physical line checks inside multiline strings (issue #242)
The trick is to attach the "# nopep8" (or "# noqa") comment after the multiline string. In fact, it just has to be on the line that ends the multiline string -- like most other noqa() checks, this is a dumb scan of the physical line, not a fancy token-based check.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/W19.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/W19.py b/testsuite/W19.py
index ac2095b..2209e38 100644
--- a/testsuite/W19.py
+++ b/testsuite/W19.py
@@ -105,6 +105,20 @@ if os.path.exists(os.path.join(path, PEP8_BIN)):
with tabs
and spaces
'''
+#: Okay
+'''sometimes, you just need to go nuts in a multiline string
+ and allow all sorts of crap
+ like mixed tabs and spaces
+
+or trailing whitespace
+or long long long long long long long long long long long long long long long long long lines
+''' # nopep8
+#: Okay
+'''this one
+ will get no warning
+even though the noqa comment is not immediately after the string
+''' + foo # noqa
+#
#: E101 W191
if foo is None and bar is "frop" and \
blah == 'yeah':