feat: allow extra kwargs
This commit is contained in:
parent
39a1595ebd
commit
f600d5cd79
1 changed files with 4 additions and 0 deletions
|
|
@ -99,6 +99,7 @@ class RougailOutputFormatter:
|
|||
rougailconfig: "RougailConfig" = None,
|
||||
user_data_errors: Optional[list] = None,
|
||||
user_data_warnings: Optional[list] = None,
|
||||
**kwargs,
|
||||
) -> None:
|
||||
self.basic_types = {
|
||||
str: "string",
|
||||
|
|
@ -213,6 +214,7 @@ class RougailOutputFormatter:
|
|||
elif isinstance(obj, Variable):
|
||||
self.parse_variable(path, obj)
|
||||
if list(self.families[self.main_namespace]) != [self.version_name]:
|
||||
# just to add an empty line space after "version"
|
||||
self.families[self.main_namespace].yaml_value_comment_extend(
|
||||
self.version_name, [CommentToken("\n\n", CommentMark(0)), None]
|
||||
)
|
||||
|
|
@ -283,6 +285,7 @@ class RougailOutputFormatter:
|
|||
del family["type"]
|
||||
if not set(family):
|
||||
ret[name] = CommentedMap()
|
||||
# just add an empty line after a family
|
||||
ret.yaml_value_comment_extend(
|
||||
name, [CommentToken("\n\n", CommentMark(0)), None]
|
||||
)
|
||||
|
|
@ -477,6 +480,7 @@ class RougailOutputFormatter:
|
|||
else:
|
||||
func = parent.yaml_value_comment_extend
|
||||
if self.remaining:
|
||||
# just to add empty line
|
||||
func(param, [CommentToken(enter, CommentMark(0)), None])
|
||||
|
||||
def object_to_yaml(self, key, type_, value, multi, object_path):
|
||||
|
|
|
|||
Loading…
Reference in a new issue