Compare commits
3 commits
a2ca13bcd6
...
bae0368356
| Author | SHA1 | Date | |
|---|---|---|---|
| bae0368356 | |||
| f600d5cd79 | |||
| 39a1595ebd |
7 changed files with 58 additions and 2 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -1,3 +1,13 @@
|
|||
## 0.1.0a20 (2025-11-03)
|
||||
|
||||
### Feat
|
||||
|
||||
- allow extra kwargs
|
||||
|
||||
### Fix
|
||||
|
||||
- update tests
|
||||
|
||||
## 0.1.0a19 (2025-10-10)
|
||||
|
||||
### Fix
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "0.1.0a19"
|
||||
__version__ = "0.1.0a20"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
%YAML 1.2
|
||||
---
|
||||
version: 1.1
|
||||
|
||||
var:
|
||||
description: the first variable
|
||||
type: integer
|
||||
multi: true
|
||||
...
|
||||
15
tests/results/02_0tags/rougail/00-base.yml
Normal file
15
tests/results/02_0tags/rougail/00-base.yml
Normal 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
|
||||
...
|
||||
|
|
@ -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
|
||||
...
|
||||
Loading…
Reference in a new issue