[Fix] Delete yapf verify parameter (#1365)

This commit is contained in:
takuoko 2023-09-24 10:25:52 +09:00 committed by GitHub
parent d617bcafdd
commit 88dc1e98b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,7 @@ from contextlib import contextmanager
from pathlib import Path
from typing import Any, Optional, Sequence, Tuple, Union
import yapf
from addict import Dict
from rich.console import Console
from rich.text import Text
@ -1472,8 +1473,11 @@ class Config:
blank_line_before_nested_class_or_def=True,
split_before_expression_after_opening_paren=True)
try:
text, _ = FormatCode(
text, style_config=yapf_style, verify=True)
if digit_version(yapf.__version__) >= digit_version('0.40.2'):
text, _ = FormatCode(text, style_config=yapf_style)
else:
text, _ = FormatCode(
text, style_config=yapf_style, verify=True)
except: # noqa: E722
raise SyntaxError('Failed to format the config file, please '
f'check the syntax of: \n{text}')