chore(api/core): apply ruff reformatting (#7624)

This commit is contained in:
Bowen Liang
2024-09-10 17:00:20 +08:00
committed by GitHub
parent 178730266d
commit 2cf1187b32
724 changed files with 21180 additions and 21123 deletions

View File

@@ -18,12 +18,12 @@ def load_yaml_file(file_path: str, ignore_error: bool = True, default_value: Any
:return: an object of the YAML content
"""
try:
with open(file_path, encoding='utf-8') as yaml_file:
with open(file_path, encoding="utf-8") as yaml_file:
try:
yaml_content = yaml.safe_load(yaml_file)
return yaml_content if yaml_content else default_value
except Exception as e:
raise YAMLError(f'Failed to load YAML file {file_path}: {e}')
raise YAMLError(f"Failed to load YAML file {file_path}: {e}")
except Exception as e:
if ignore_error:
return default_value