qodo-cover
qodo-cover copied to clipboard
Improved typing and minor fix in yaml utils methods
User Description
- Changed default args to None, mutable defaults like lists are not recommend in python as they are stateful in subsequent calls.
- Removed some f strings where the string was static.
-
load_yaml
had a path which could have returned None, causing the dict read after that step to raise an exception, I've added an explicit exception inload_yaml
in casetry_fix_yaml
fails as well.
PR Type
Enhancement, Bug fix
Description
- Added
from __future__ import annotations
for forward compatibility. - Changed
keys_fix_yaml
parameter type fromList[str]
toOptional[List[str]]
inload_yaml
andtry_fix_yaml
functions. - Added checks for
None
and defaultedkeys_fix_yaml
to an empty list if not provided. - Improved error handling by raising an exception when YAML parsing fails after attempting to fix formatting.
- Removed redundant f-strings in logging statements.
Changes walkthrough ๐
Relevant files | |||
---|---|---|---|
Enhancement |
|
๐ก PR-Agent usage: Comment
/help
on the PR to get a list of all available PR-Agent tools and their descriptions