Skip to content

Commit be26ff3

Browse files
committed
YapfBear: Disable syntax verification
Syntax verification is supposed to be a private feature in yapf, used for debugging, but they're still defaulting its flag to True on the public FormatFile function. We need to set it to False to disable syntax error checking in yapf (which seems to be an unmaintained feature of it, since it raises exceptions on async/await and Python 2's print statement), see discussion at google/yapf#293 Fixes #738
1 parent d34239a commit be26ff3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bears/python/YapfBear.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ def run(self, filename, file,
142142
with prepare_file(options.splitlines(keepends=True),
143143
None) as (file_, fname):
144144
corrected = FormatFile(filename,
145-
style_config=fname)[0].splitlines(True)
145+
style_config=fname,
146+
verify=False)[0].splitlines(True)
146147
diffs = Diff.from_string_arrays(file, corrected).split_diff()
147148
for diff in diffs:
148149
yield Result(self,

0 commit comments

Comments
 (0)