Compare commits

..

3 commits

7 changed files with 58 additions and 2 deletions

View file

@ -1,3 +1,13 @@
## 0.1.0a20 (2025-11-03)
### Feat
- allow extra kwargs
### Fix
- update tests
## 0.1.0a19 (2025-10-10)
### Fix

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project]
name = "rougail.output_formatter"
version = "0.1.0a19"
version = "0.1.0a20"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md"
description = "Rougail output formatter"

View file

@ -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):

View file

@ -1 +1 @@
__version__ = "0.1.0a19"
__version__ = "0.1.0a20"

View file

@ -0,0 +1,9 @@
%YAML 1.2
---
version: 1.1
var:
description: the first variable
type: integer
multi: true
...

View file

@ -0,0 +1,15 @@
%YAML 1.2
---
version: 1.1
var1:
description: the first variable
tags:
- one_tag
var2:
description: the second variable
tags:
- one_tag
- second_tag
...

View file

@ -0,0 +1,18 @@
%YAML 1.2
---
version: 1.1
var:
description: A suffix variable
default:
- val1
- val2
hidden: true
dyn{{ identifier }}:
description: A dynamic family
dynamic:
variable: _.var
var: # A dynamic variable
...