Closed DRMacIver closed 9 years ago
I'm not able to replicate this bug. I appreciate the reports. I'd be interested in looking at the fuzzer. :-)
[morbo:yapf] python ./build/lib/yapf --diff /tmp/bad.py
--- /tmp/bad.py (original)
+++ /tmp/bad.py (reformatted)
@@ -1,5 +1,5 @@
class YapfTest(unittest.TestCase):
- def testSimple(self):
- unformatted_code = textwrap.dedent(u"""\
+ def testSimple(self):
+ unformatted_code = textwrap.dedent(u"""\
print('foo')
""")
Is there some command line option that I'm missing?
Ah! Apologies. This is only reproducible on python 3.2 it turns out (possibly others, but it works correctly on python 2.7 and python 3.4, I don't have any others readily to hand)
Here's the current copy of the fuzzer: https://gist.github.com/DRMacIver/a10e2624e5529b70d881
Note embedded disclaimer about how it's terrible. You probably don't want to actually use this code :-)
Given that you don't support 3.2, I'll close this as invalid. I've patched the fuzzer to let me set the python version properly. :-)
The following code:
Gives the following error:
...as you can probably tell, by this point I have a fuzzer doing most of the work for me (about the first half + a few of the subsequent ones have been hand produced) and this is from turning it on the yapf codebase itself. If you want it I'd be happy to give you a copy of the fuzzer.