Compare commits
23 commits
Author | SHA1 | Date | |
---|---|---|---|
e4b045ab75 | |||
d5f46d305b | |||
1abdf419e6 | |||
307c2933c5 | |||
b2f2aa4406 | |||
5f46162790 | |||
66f044bee3 | |||
c09800521c | |||
4e9e8b082e | |||
a4eab14564 | |||
88f837aa07 | |||
03d24af05c | |||
2adef78db3 | |||
9159f44efa | |||
75fc04c501 | |||
99a41bd4e5 | |||
ec8a9c0aab | |||
232a8385a3 | |||
ad4e3ffd6e | |||
29c1941993 | |||
9c55b5aa25 | |||
ad707df62d | |||
2227438899 |
88 changed files with 713 additions and 121 deletions
CHANGELOG.mdpyproject.tomltest_load.py
src/rougail/output_formatter
tests
results
00_2default_calculated_multi/rougail
00_6choice_calculation/rougail
00_6choice_link/rougail
00_6choice_variable_link/rougail
00_6choice_variable_link2/rougail
00_6regexp_link/rougail
00_6secret/rougail
00_6secret_param/rougail
00_7help/rougail
00_7help_sup/rougail
00_8calculation_information/rougail
00_8calculation_namespace/rougail
00_8calculation_param_namespace/rougail
00_9default_calculation_param_optional/rougail
00_9default_integer/rougail
01_8calculation_information_multi/rougail
04_1auto_save_and_calculated_hidden/rougail
04_1default_calculation_hidden/rougail
04_1default_calculation_hidden_2/rougail
04_5disabled_calculation/rougail
04_5disabled_calculation_default/rougail
04_5disabled_calculation_multi/rougail
04_5disabled_calculation_optional/rougail
04_5disabled_calculation_variable_multi/rougail
04_5disabled_calculation_variable_multi2/rougail
04_5disabled_calculation_variable_multi3/rougail
04_5hidden_calculation/rougail
04_5hidden_calculation2/rougail
04_5hidden_calculation_default_calculation/rougail
04_5validators/rougail
04_5validators_differ/rougail
04_5validators_multi/rougail
04_5validators_multi2/rougail
16_5redefine_remove_disable_calculation/rougail
16_6exists_family/rougail
20_0validators_differ_redefine/rougail
20_9family_absolute/rougail
24_0family_hidden_condition/rougail
24_0family_hidden_condition_boolean/rougail
24_0family_hidden_condition_sub_family/rougail
24_0family_hidden_condition_with_variable/rougail
24_0family_hidden_param_condition_sub_family/rougail
24_0family_mandatory_condition/rougail
24_7validators_variable_optional/rougail
40_1leadership_append_follower/rougail
40_6leadership_follower_multi/rougail
40_8calculation_boolean/rougail
40_8calculation_boolean_return_none/rougail
40_8calculation_integer/rougail
40_9leadership-calculation-outside-follower-first/rougail
40_9leadership-calculation-outside-follower-last/rougail
40_9leadership-calculation-outside-follower/rougail
40_9leadership-calculation-outside-leader-first/rougail
40_9leadership-calculation-outside-leader-last/rougail
40_9leadership-calculation-outside-leader/rougail
44_4disabled_calcultion_follower/rougail
44_4leadership_mandatory/rougail
44_5leadership_leader_hidden_calculation/rougail
44_6leadership_follower_disabled_calculation/rougail
44_9calculated_default_leadership_leader/rougail
60_0family_dynamic_forbidden_char/rougail
60_0family_dynamic_jinja_number_empty/rougail
60_1family_dynamic_jinja/rougail
60_2family_dynamic_jinja_fill_sub_group_2_empty/rougail
60_2family_dynamic_jinja_fill_sub_group_empty/rougail
60_2family_dynamic_outside_calc_empty/rougail
60_5family_dynamic_calc2/rougail
60_5family_dynamic_calc2_empty/rougail
60_5family_dynamic_calc_suffix_empty_2/rougail
60_5family_dynamic_calc_suffix_empty_3/rougail
60_5family_dynamic_hidden_suffix/rougail
60_5family_dynamic_unknown_suffix/rougail
60_5family_dynamic_unknown_suffix_empty/rougail
60_5family_dynamic_variable_outside_1_0/rougail
60_5family_dynamic_variable_outside_jinja/rougail
60_5family_dynamic_variable_outside_jinja_empty/rougail
60_6family_dynamic_leadership/rougail
60_6family_dynamic_leadership_empty/rougail
60_6family_dynamic_sub_dynamic/rougail
60_6family_dynamic_sub_dynamic_1_0/rougail
60_6family_dynamic_sub_dynamic_empty/rougail
65
CHANGELOG.md
Normal file
65
CHANGELOG.md
Normal file
|
@ -0,0 +1,65 @@
|
|||
## 0.1.0a8 (2025-04-01)
|
||||
|
||||
### Fix
|
||||
|
||||
- update tests
|
||||
|
||||
## 0.1.0a7 (2025-03-30)
|
||||
|
||||
### Feat
|
||||
|
||||
- support multi lines for help
|
||||
|
||||
## 0.1.0a6 (2025-03-28)
|
||||
|
||||
### Fix
|
||||
|
||||
- do not add multi \n at ends of export
|
||||
|
||||
## 0.1.0a5 (2025-03-27)
|
||||
|
||||
### Fix
|
||||
|
||||
- if and for in 3 lines
|
||||
|
||||
## 0.1.0a4 (2025-03-27)
|
||||
|
||||
### Feat
|
||||
|
||||
- format jinja template
|
||||
|
||||
## 0.1.0a3 (2025-03-27)
|
||||
|
||||
### Feat
|
||||
|
||||
- add secret_manager support
|
||||
- add Namespace(Param|Calculation) support
|
||||
|
||||
### Fix
|
||||
|
||||
- do not add namespace in param
|
||||
- an empty variable is []
|
||||
|
||||
## 0.1.0a2 (2025-03-26)
|
||||
|
||||
### Fix
|
||||
|
||||
- pyproject.toml
|
||||
|
||||
## 0.1.0a1 (2025-03-26)
|
||||
|
||||
### Fix
|
||||
|
||||
- add pyproject.toml
|
||||
|
||||
## 0.1.0a0 (2025-02-10)
|
||||
|
||||
### Feat
|
||||
|
||||
- output return status too
|
||||
|
||||
## 0.0.1a0 (2025-01-04)
|
||||
|
||||
### Fix
|
||||
|
||||
- remove prefix_path
|
43
pyproject.toml
Normal file
43
pyproject.toml
Normal file
|
@ -0,0 +1,43 @@
|
|||
[build-system]
|
||||
build-backend = "flit_core.buildapi"
|
||||
requires = ["flit_core >=3.8.0,<4"]
|
||||
|
||||
[project]
|
||||
name = "rougail.output_formatter"
|
||||
version = "0.1.0a8"
|
||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||
readme = "README.md"
|
||||
description = "Rougail output formatter"
|
||||
requires-python = ">=3.8"
|
||||
license = {file = "LICENSE"}
|
||||
classifiers = [
|
||||
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
"Programming Language :: Python :: 3.14",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Operating System :: OS Independent",
|
||||
"Natural Language :: English",
|
||||
"Natural Language :: French",
|
||||
|
||||
]
|
||||
dependencies = [
|
||||
"rougail >= 1.1,<2",
|
||||
"djlint == 1.36.4",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Home = "https://forge.cloud.silique.fr/stove/rougail-output-formatter"
|
||||
|
||||
[tool.commitizen]
|
||||
name = "cz_conventional_commits"
|
||||
tag_format = "$version"
|
||||
version_scheme = "pep440"
|
||||
version_provider = "pep621"
|
||||
update_changelog_on_bump = true
|
||||
changelog_merge_prerelease = true
|
|
@ -1,6 +1,6 @@
|
|||
"""
|
||||
Silique (https://www.silique.fr)
|
||||
Copyright (C) 2024
|
||||
Copyright (C) 2024-2025
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by the
|
||||
|
@ -25,13 +25,16 @@ from ruamel.yaml import YAML, CommentedMap
|
|||
from ruamel.yaml.tokens import CommentToken
|
||||
from ruamel.yaml.error import CommentMark
|
||||
from ruamel.yaml.comments import CommentedSeq
|
||||
from ruamel.yaml.scalarstring import LiteralScalarString, FoldedScalarString
|
||||
from ruamel.yaml.scalarstring import LiteralScalarString, FoldedScalarString, ScalarString
|
||||
|
||||
from djlint.settings import Config
|
||||
from djlint.reformat import formatter
|
||||
|
||||
from tiramisu import undefined
|
||||
from tiramisu.config import get_common_path
|
||||
|
||||
from rougail.convert import RougailConvert
|
||||
from rougail.object_model import Variable, Family, Calculation, JinjaCalculation, IdentifierCalculation, IdentifierPropertyCalculation, IdentifierParam, IndexCalculation, IndexParam, Param
|
||||
from rougail.object_model import Variable, Family, Calculation, JinjaCalculation, IdentifierCalculation, IdentifierPropertyCalculation, NamespaceCalculation, IdentifierParam, IndexCalculation, IndexParam, NamespaceParam, Param
|
||||
from rougail.utils import normalize_family
|
||||
|
||||
from .upgrade import RougailUpgrade
|
||||
|
@ -72,6 +75,12 @@ class RougailOutputFormatter:
|
|||
filename = Path(filenames[0])
|
||||
if not filename.is_file():
|
||||
raise Exception(_('only a file is allowed'))
|
||||
|
||||
self.config = Config()
|
||||
self.config.profile = 'jinja'
|
||||
self.config.line_break_after_multiline_tag = True
|
||||
self.config.indent = " "
|
||||
|
||||
self.original_yaml = RougailUpgrade(rougailconfig).run(filename)
|
||||
datas = RougailUpgrade(rougailconfig).run(filename)
|
||||
self.rougail = RougailConvert(rougailconfig)
|
||||
|
@ -106,11 +115,13 @@ class RougailOutputFormatter:
|
|||
self.default_flow_style = False
|
||||
with BytesIO() as ymlfh:
|
||||
self.yaml.dump(self.families[None], ymlfh)
|
||||
ret = ymlfh.getvalue().decode("utf-8").strip() + '\n'
|
||||
return ret
|
||||
ret = ymlfh.getvalue().decode("utf-8").strip()
|
||||
return True, ret
|
||||
|
||||
def print(self):
|
||||
print(self.run())
|
||||
ret, data = self.run()
|
||||
print(data)
|
||||
return ret
|
||||
|
||||
def parse(self):
|
||||
# FIXME path to relative !
|
||||
|
@ -159,7 +170,7 @@ class RougailOutputFormatter:
|
|||
else:
|
||||
attributes = self.families_attributes
|
||||
for attr, default_value in attributes.items():
|
||||
if attr in ["name", "path", "namespace", "version", "path_prefix", "xmlfiles"]:
|
||||
if attr in ["name", "path", "namespace", "version", "xmlfiles"]:
|
||||
continue
|
||||
try:
|
||||
value = getattr(obj, attr)
|
||||
|
@ -204,7 +215,7 @@ class RougailOutputFormatter:
|
|||
multi = obj.multi or isinstance(obj.default, list)
|
||||
type_ = obj.type
|
||||
for attr, default_value in self.variables_attributes.items():
|
||||
if attr in ["name", "path", "namespace", "version", "path_prefix", "xmlfiles"]:
|
||||
if attr in ["name", "path", "namespace", "version", "xmlfiles"]:
|
||||
continue
|
||||
try:
|
||||
value = getattr(obj, attr)
|
||||
|
@ -238,6 +249,9 @@ class RougailOutputFormatter:
|
|||
# if boolean, the default value is True
|
||||
del variable["type"]
|
||||
variable["default"] = True
|
||||
if "default" not in variable and variable.get("multi") is True and not set(variable) - {'default', 'description', "multi"}:
|
||||
variable["default"] = []
|
||||
del(variable['multi'])
|
||||
if not isinstance(variable.get("default"), dict) and not set(variable) - {'default', 'description'}:
|
||||
# shorthand notation
|
||||
default = variable.get('default')
|
||||
|
@ -271,12 +285,16 @@ class RougailOutputFormatter:
|
|||
return _get_last_obj(o[param], o, param, 'seq')
|
||||
return typ, parent, param
|
||||
param = list(obj)[-1]
|
||||
if isinstance(obj[param], ScalarString):
|
||||
enter = '\n'
|
||||
else:
|
||||
enter = '\n\n'
|
||||
typ, parent, param = _get_last_obj(obj[param], obj, param, 'map')
|
||||
if typ == 'seq':
|
||||
func = parent.yaml_key_comment_extend
|
||||
else:
|
||||
func = parent.yaml_value_comment_extend
|
||||
func(param, [CommentToken('\n\n', CommentMark(0)), None])
|
||||
func(param, [CommentToken(enter, CommentMark(0)), None])
|
||||
|
||||
def object_to_yaml(self, key, type_, value, multi, object_path):
|
||||
if isinstance(value, list):
|
||||
|
@ -293,11 +311,18 @@ class RougailOutputFormatter:
|
|||
return new_values
|
||||
if isinstance(value, JinjaCalculation):
|
||||
jinja = CommentedMap()
|
||||
# replace \n to space a add index of \n (now a space) to fold_pos
|
||||
jinja_values = value.jinja.strip()
|
||||
jinja_values = formatter(self.config, value.jinja.strip())[:-1]
|
||||
if key == 'default' and not multi:
|
||||
jinja["jinja"] = FoldedScalarString(jinja_values.replace('\n', ' '))
|
||||
jinja["jinja"].fold_pos = [i for i, ltr in enumerate(jinja_values) if ltr == '\n']
|
||||
jinja["jinja"] = FoldedScalarString(jinja_values)
|
||||
fold_pos = []
|
||||
old_i = 0
|
||||
for i, ltr in enumerate(jinja_values):
|
||||
if ltr == '\n':
|
||||
fold_pos.append(i - old_i)
|
||||
old_i = 1
|
||||
jinja["jinja"].fold_pos = fold_pos
|
||||
elif key == 'secret_manager':
|
||||
return self.object_to_yaml("params", type_, value.params, multi, object_path)
|
||||
else:
|
||||
jinja["jinja"] = LiteralScalarString(jinja_values)
|
||||
if value.return_type:
|
||||
|
@ -312,8 +337,10 @@ class RougailOutputFormatter:
|
|||
variable = CommentedMap()
|
||||
if isinstance(value, (IdentifierCalculation, IdentifierPropertyCalculation)):
|
||||
variable["type"] = "identifier"
|
||||
if isinstance(value, IndexCalculation):
|
||||
elif isinstance(value, IndexCalculation):
|
||||
variable["type"] = "index"
|
||||
elif isinstance(value, NamespaceCalculation):
|
||||
variable["type"] = "namespace"
|
||||
for key, default in variable_attributes.items():
|
||||
val = getattr(value, key)
|
||||
if val != default and val is not undefined:
|
||||
|
@ -324,15 +351,17 @@ class RougailOutputFormatter:
|
|||
del variable["type"]
|
||||
return variable
|
||||
elif isinstance(value, Param):
|
||||
param_attributes = self.get_object_informations(value, ["type", "key"])
|
||||
param_attributes = self.get_object_informations(value, ["type", "key", "namespace"])
|
||||
if list(param_attributes) == ['value']:
|
||||
variable = value.value
|
||||
else:
|
||||
variable = CommentedMap()
|
||||
if isinstance(value, IdentifierParam):
|
||||
variable["type"] = "identifier"
|
||||
if isinstance(value, IndexParam):
|
||||
elif isinstance(value, IndexParam):
|
||||
variable["type"] = "index"
|
||||
elif isinstance(value, NamespaceParam):
|
||||
variable["type"] = "namespace"
|
||||
for key, default in param_attributes.items():
|
||||
val = getattr(value, key)
|
||||
if val != default and val is not undefined:
|
||||
|
@ -344,6 +373,8 @@ class RougailOutputFormatter:
|
|||
return {value.key: variable}
|
||||
elif type_ == 'port' and isinstance(value, str) and value.isnumeric():
|
||||
return int(value)
|
||||
elif key == 'help' and '\n' in value:
|
||||
return LiteralScalarString(value)
|
||||
return value
|
||||
|
||||
def calc_variable_path(self, object_path, variable_path):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"""
|
||||
Silique (https://www.silique.fr)
|
||||
Copyright (C) 2024
|
||||
Copyright (C) 2024-2025
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by the
|
||||
|
@ -29,14 +29,14 @@ load_unexist_redefine:
|
|||
type: boolean
|
||||
default:
|
||||
jinja: >-
|
||||
{% if step.output == 'formatter' %}
|
||||
{% if step.output is not propertyerror and step.output == 'formatter' %}
|
||||
true
|
||||
{% else %}
|
||||
false
|
||||
{% endif %}
|
||||
hidden:
|
||||
jinja: >-
|
||||
{% if step.output == 'formatter' %}
|
||||
{% if step.output is not propertyerror and step.output == 'formatter' %}
|
||||
load_unexist_redefine is always true with 'formatter' output
|
||||
{% endif %}
|
||||
"""
|
||||
|
|
|
@ -4,7 +4,7 @@ Cadoles (http://www.cadoles.com)
|
|||
Copyright (C) 2021
|
||||
|
||||
Silique (https://www.silique.fr)
|
||||
Copyright (C) 2022-2024
|
||||
Copyright (C) 2022-2025
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by the
|
||||
|
|
|
@ -12,6 +12,6 @@ var2:
|
|||
default:
|
||||
jinja: |-
|
||||
{% for val in _.var1 %}
|
||||
{{ val }}
|
||||
{{ val }}
|
||||
{% endfor %}
|
||||
description: the value of _.var1
|
||||
|
|
|
@ -6,7 +6,7 @@ var:
|
|||
choices:
|
||||
jinja: |-
|
||||
{% for n in trange(0, 10) %}
|
||||
{{ n }}
|
||||
{{ n }}
|
||||
{% endfor %}
|
||||
return_type: number
|
||||
description: choices is 0 to 9
|
||||
|
|
14
tests/results/00_6choice_link/rougail/00-base.yml
Normal file
14
tests/results/00_6choice_link/rougail/00-base.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var1:
|
||||
description: the first variable
|
||||
choices:
|
||||
- a
|
||||
- b
|
||||
- c
|
||||
|
||||
var2:
|
||||
description: the second variable
|
||||
default:
|
||||
variable: _.var1
|
18
tests/results/00_6choice_variable_link/rougail/00-base.yml
Normal file
18
tests/results/00_6choice_variable_link/rougail/00-base.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var1: # a second variable
|
||||
- a
|
||||
- b
|
||||
- c
|
||||
|
||||
var2:
|
||||
description: a first variable
|
||||
choices:
|
||||
variable: _.var1
|
||||
default: a
|
||||
|
||||
var3:
|
||||
description: a third variable
|
||||
default:
|
||||
variable: _.var2
|
20
tests/results/00_6choice_variable_link2/rougail/00-base.yml
Normal file
20
tests/results/00_6choice_variable_link2/rougail/00-base.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var1: # a second variable
|
||||
- a
|
||||
- b
|
||||
- c
|
||||
|
||||
var2:
|
||||
description: a first variable
|
||||
choices:
|
||||
variable: _.var1
|
||||
default: a
|
||||
|
||||
family:
|
||||
|
||||
var3:
|
||||
description: a third variable
|
||||
default:
|
||||
variable: __.var2
|
18
tests/results/00_6regexp_link/rougail/00-base.yml
Normal file
18
tests/results/00_6regexp_link/rougail/00-base.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var1:
|
||||
description: a first variable
|
||||
test:
|
||||
- '#b1b1b1'
|
||||
- '#b2b2b2'
|
||||
regexp: ^#(?:[0-9a-f]{3}){1,2}$
|
||||
default: '#a1a1a1'
|
||||
|
||||
var2:
|
||||
description: a second variable
|
||||
test:
|
||||
- '#b2b1b1'
|
||||
- '#b3b2b2'
|
||||
default:
|
||||
variable: _.var1
|
11
tests/results/00_6secret/rougail/00-base.yml
Normal file
11
tests/results/00_6secret/rougail/00-base.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
secret1:
|
||||
description: the first variable
|
||||
type: secret
|
||||
|
||||
secret2:
|
||||
description: the second variable
|
||||
type: secret
|
||||
default: value
|
27
tests/results/00_6secret_param/rougail/00-base.yml
Normal file
27
tests/results/00_6secret_param/rougail/00-base.yml
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
secret1:
|
||||
description: the first variable
|
||||
type: secret
|
||||
params:
|
||||
min_len: 10
|
||||
|
||||
secret2:
|
||||
description: the second variable
|
||||
type: secret
|
||||
params:
|
||||
max_len: 10
|
||||
forbidden_char:
|
||||
- $
|
||||
- ^
|
||||
default: value
|
||||
|
||||
secret3:
|
||||
description: the third variable
|
||||
type: secret
|
||||
params:
|
||||
max_len: 10
|
||||
forbidden_char:
|
||||
- $
|
||||
default: value
|
18
tests/results/00_7help/rougail/00-base.yml
Normal file
18
tests/results/00_7help/rougail/00-base.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var1:
|
||||
description: the first variable
|
||||
help: |-
|
||||
Multi line
|
||||
|
||||
Help
|
||||
|
||||
With useful information
|
||||
|
||||
var2:
|
||||
description: the second variable
|
||||
help: |-
|
||||
Multi line
|
||||
Help
|
||||
With useful information
|
18
tests/results/00_7help_sup/rougail/00-base.yml
Normal file
18
tests/results/00_7help_sup/rougail/00-base.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var1:
|
||||
description: the first <variable>
|
||||
help: |-
|
||||
Multi line
|
||||
|
||||
<Help>
|
||||
|
||||
With useful information
|
||||
|
||||
var2:
|
||||
description: the second <variable>
|
||||
help: |-
|
||||
Multi line
|
||||
<Help>
|
||||
With useful information
|
|
@ -5,7 +5,7 @@ variable:
|
|||
description: a variable
|
||||
default:
|
||||
jinja: >-
|
||||
{{test_information }}
|
||||
{{ test_information }}
|
||||
description: get information test_information
|
||||
params:
|
||||
test_information:
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
variable:
|
||||
description: a variable
|
||||
default:
|
||||
type: namespace
|
||||
mandatory: false
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
variable:
|
||||
description: a variable
|
||||
default:
|
||||
jinja: >-
|
||||
{{ namespace }}
|
||||
params:
|
||||
namespace:
|
||||
type: namespace
|
||||
mandatory: false
|
|
@ -5,8 +5,15 @@ var1:
|
|||
description: a first variable
|
||||
default:
|
||||
jinja: >-
|
||||
{% if var2 is defined %} {{ var2 }} {% elif var3 is defined %} {{ var3 }} {%
|
||||
elif var4 is defined %} {{ var4 }} {% else %} {{ _.var2 }} {% endif %}
|
||||
{% if var2 is defined %}
|
||||
{{ var2 }}
|
||||
{% elif var3 is defined %}
|
||||
{{ var3 }}
|
||||
{% elif var4 is defined %}
|
||||
{{ var4 }}
|
||||
{% else %}
|
||||
{{ _.var2 }}
|
||||
{% endif %}
|
||||
description: returns a value
|
||||
params:
|
||||
var2:
|
||||
|
|
|
@ -6,7 +6,7 @@ var:
|
|||
choices:
|
||||
jinja: |-
|
||||
{% for item in trange(0, 10) %}
|
||||
{{ item }}
|
||||
{{ item }}
|
||||
{%- endfor %}
|
||||
return_type: number
|
||||
description: choice for 0 to 9
|
||||
|
|
|
@ -7,7 +7,7 @@ variable:
|
|||
default:
|
||||
jinja: |-
|
||||
{% for info in test_information %}
|
||||
{{ info }}
|
||||
{{ info }}
|
||||
{% endfor %}
|
||||
description: get information test_information
|
||||
params:
|
||||
|
|
|
@ -13,6 +13,6 @@ var2:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if _.var1 == "yes" %}
|
||||
_.var1 is yes
|
||||
_.var1 is yes
|
||||
{% endif %}
|
||||
description: only if the variable var1 has value "yes"
|
||||
|
|
|
@ -14,5 +14,5 @@ var3:
|
|||
default:
|
||||
jinja: >-
|
||||
{% if _.var1 == 'value' or _.var2 == 'blah' %}
|
||||
value
|
||||
value
|
||||
{% endif %}
|
||||
|
|
|
@ -14,5 +14,5 @@ var3:
|
|||
default:
|
||||
jinja: >-
|
||||
{% if _.var2 is propertyerror %}
|
||||
value
|
||||
value
|
||||
{% endif %}
|
||||
|
|
|
@ -8,7 +8,7 @@ variable1:
|
|||
disabled:
|
||||
jinja: |-
|
||||
{% if _.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is egal to "yes"
|
||||
|
||||
|
@ -17,6 +17,6 @@ variable2:
|
|||
disabled:
|
||||
jinja: |-
|
||||
{% if _.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is egal to "yes"
|
||||
|
|
|
@ -12,7 +12,7 @@ var1:
|
|||
disabled:
|
||||
jinja: |-
|
||||
{% if _.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
||||
|
@ -25,6 +25,6 @@ var2:
|
|||
disabled:
|
||||
jinja: |-
|
||||
{% if rougail.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
condition: no # a conditional variable
|
||||
|
||||
variable1:
|
||||
description: a first variable
|
||||
multi: true
|
||||
disabled:
|
||||
jinja: |-
|
||||
{% if _.condition == "yes" %}
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is egal to "yes"
|
||||
|
||||
variable2:
|
||||
description: a second variable
|
||||
multi: true
|
||||
disabled:
|
||||
jinja: |-
|
||||
{% if _.condition == "yes" %}
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is egal to "yes"
|
|
@ -9,9 +9,9 @@ var1:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if unknown is not defined %}
|
||||
unknown is undefined
|
||||
unknown is undefined
|
||||
{% elif unknown == "no" %}
|
||||
unknown is no
|
||||
unknown is no
|
||||
{% endif %}
|
||||
description: calculation from an unknown variable
|
||||
params:
|
||||
|
@ -25,9 +25,9 @@ var2:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if condition is not defined %}
|
||||
condition is undefined
|
||||
condition is undefined
|
||||
{% elif condition == "no" %}
|
||||
condition is no
|
||||
condition is no
|
||||
{% endif %}
|
||||
description: calculation from an condition variable
|
||||
params:
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
condition: false # a condition
|
||||
|
||||
variable:
|
||||
description: a variable
|
||||
multi: true
|
||||
disabled:
|
||||
variable: _.condition
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
condition: [] # a condition
|
||||
|
||||
variable:
|
||||
description: a variable
|
||||
multi: true
|
||||
disabled:
|
||||
variable: _.condition
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
condition: # a condition
|
||||
- val1
|
||||
- val2
|
||||
|
||||
variable:
|
||||
description: a variable
|
||||
multi: true
|
||||
disabled:
|
||||
variable: _.condition
|
|
@ -9,7 +9,7 @@ var1:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if _.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
||||
|
@ -19,6 +19,6 @@ var2:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if rougail.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
|
|
@ -12,7 +12,7 @@ var1:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if _.condition != "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
||||
|
@ -25,6 +25,6 @@ var2:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if rougail.condition != "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
|
|
@ -12,7 +12,7 @@ var1:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if _.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
||||
|
@ -25,6 +25,6 @@ var2:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if rougail.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
|
|
@ -7,6 +7,6 @@ int:
|
|||
validators:
|
||||
- jinja: |-
|
||||
{% if _.int > 100 %}
|
||||
value is too high
|
||||
value is too high
|
||||
{% endif %}
|
||||
description: the max value is 100
|
||||
|
|
|
@ -8,7 +8,7 @@ var1:
|
|||
validators:
|
||||
- jinja: |-
|
||||
{% if _.var1 == _.var2 %}
|
||||
var1 must be different than var2
|
||||
var1 must be different than var2
|
||||
{% endif %}
|
||||
description: var1 must be different than var2
|
||||
default: oui
|
||||
|
|
|
@ -6,7 +6,7 @@ var1:
|
|||
validators:
|
||||
- jinja: |-
|
||||
{% if _.var1 | length > 9 %}
|
||||
length must be less than 10
|
||||
length must be less than 10
|
||||
{% endif %}
|
||||
description: check length is less than 10
|
||||
default:
|
||||
|
|
|
@ -9,7 +9,7 @@ var1:
|
|||
validators:
|
||||
- jinja: |-
|
||||
{% if values | length > 2 %}
|
||||
length must be less than 3
|
||||
length must be less than 3
|
||||
{% endif %}
|
||||
description: check length is less than 3
|
||||
params:
|
||||
|
|
|
@ -8,7 +8,7 @@ variable:
|
|||
disabled:
|
||||
jinja: |-
|
||||
{% if _.condition == "yes" %}
|
||||
true
|
||||
true
|
||||
{% else %}
|
||||
false
|
||||
false
|
||||
{% endif %}
|
||||
|
|
7
tests/results/16_6exists_family/rougail/00-test.yml
Normal file
7
tests/results/16_6exists_family/rougail/00-test.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
family:
|
||||
exists: true
|
||||
|
||||
variable:
|
|
@ -12,7 +12,7 @@ var3:
|
|||
validators:
|
||||
- jinja: |-
|
||||
{% if _.var3 == _.var1 %}
|
||||
var3 must be different than var1
|
||||
var3 must be different than var1
|
||||
{% endif %}
|
||||
description: var3 must be different than var1
|
||||
default: yes
|
||||
|
|
|
@ -6,6 +6,6 @@ var3:
|
|||
validators:
|
||||
- jinja: |-
|
||||
{% if _.var3 == _.var2 %}
|
||||
var3 must be different than var2
|
||||
var3 must be different than var2
|
||||
{% endif %}
|
||||
description: var3 must be different than var2
|
||||
|
|
|
@ -1,27 +1,36 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var1: # a variable
|
||||
var1: # first variable
|
||||
|
||||
family: # a family
|
||||
|
||||
var2: # a second variable
|
||||
var2:
|
||||
description: a second variable
|
||||
test:
|
||||
- string6
|
||||
|
||||
subfamily: # a sub family
|
||||
subfamily: # a sub family
|
||||
|
||||
variable: # a variable
|
||||
variable: # third variable
|
||||
- variable: ___.var1
|
||||
- variable: __.var2
|
||||
|
||||
family2: # a family
|
||||
|
||||
var2:
|
||||
description: a variable2
|
||||
default:
|
||||
variable: __.family.var2
|
||||
|
||||
var3:
|
||||
test:
|
||||
- string5
|
||||
default: string4
|
||||
|
||||
subfamily: # a sub family
|
||||
|
||||
variable: # a variable
|
||||
variable: # fourth variable
|
||||
- variable: ___.var1
|
||||
- variable: ___.family.var2
|
||||
- variable: __.var2
|
||||
- variable: __.var3
|
||||
|
|
|
@ -8,7 +8,7 @@ family:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if rougail.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ family:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if not rougail.condition %}
|
||||
condition is false
|
||||
condition is false
|
||||
{% endif %}
|
||||
description: if not condition
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ family:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if _.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ family:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if not rougail.condition1 %}
|
||||
condition1 is false
|
||||
condition1 is false
|
||||
{% endif %}
|
||||
description: if condition1 is false
|
||||
|
||||
|
@ -20,6 +20,6 @@ family:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if rougail.condition2 %}
|
||||
condition2 is true
|
||||
condition2 is true
|
||||
{% endif %}
|
||||
description: if condition2 is false
|
||||
|
|
|
@ -8,7 +8,7 @@ family:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
params:
|
||||
|
|
|
@ -8,6 +8,6 @@ var:
|
|||
mandatory:
|
||||
jinja: |-
|
||||
{% if _.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: only if rougail.condition has the value "yes"
|
||||
|
|
|
@ -11,7 +11,7 @@ general: # a family
|
|||
validators:
|
||||
- jinja: |-
|
||||
{% if _.int == int2 %}
|
||||
int and int2 must be different
|
||||
int and int2 must be different
|
||||
{% endif %}
|
||||
description: int and int2 must be different
|
||||
params:
|
||||
|
@ -20,7 +20,7 @@ general: # a family
|
|||
optional: true
|
||||
- jinja: |-
|
||||
{% if int3 is defined and _.int == int3 %}
|
||||
int and int3 must be different
|
||||
int and int3 must be different
|
||||
{% endif %}
|
||||
description: int and int3 must be different
|
||||
params:
|
||||
|
|
|
@ -5,10 +5,8 @@ leader:
|
|||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader:
|
||||
description: the leader
|
||||
multi: true
|
||||
leader: [] # the leader
|
||||
|
||||
follower1: # the follower1
|
||||
follower1: # the follower1
|
||||
|
||||
follower2: # the follower2
|
||||
|
|
|
@ -5,13 +5,9 @@ leadership:
|
|||
description: A leadership
|
||||
type: leadership
|
||||
|
||||
leader:
|
||||
description: The leader
|
||||
multi: true
|
||||
leader: [] # The leader
|
||||
|
||||
follower1:
|
||||
description: The first follower
|
||||
multi: true
|
||||
follower1: [] # The first follower
|
||||
|
||||
follower2: # The second follower
|
||||
follower2: # The second follower
|
||||
- value
|
||||
|
|
|
@ -10,10 +10,10 @@ multi1:
|
|||
default:
|
||||
jinja: |-
|
||||
{% if _.bool %}
|
||||
True
|
||||
False
|
||||
True
|
||||
False
|
||||
{% else %}
|
||||
False
|
||||
False
|
||||
{% endif %}
|
||||
description: a calculation
|
||||
|
||||
|
@ -24,9 +24,9 @@ multi2:
|
|||
default:
|
||||
jinja: |-
|
||||
{% if not _.bool %}
|
||||
True
|
||||
False
|
||||
True
|
||||
False
|
||||
{% else %}
|
||||
False
|
||||
False
|
||||
{% endif %}
|
||||
description: a calculation
|
||||
|
|
|
@ -9,6 +9,6 @@ var2:
|
|||
default:
|
||||
jinja: >-
|
||||
{% if rougail.var1 == 'no' %}
|
||||
false
|
||||
false
|
||||
{% endif %}
|
||||
description: return false if the value of var1 is "no"
|
||||
|
|
|
@ -8,7 +8,11 @@ int1:
|
|||
type: number
|
||||
default:
|
||||
jinja: >-
|
||||
{% if rougail.bool %}1{% else %}2{% endif %}
|
||||
{% if rougail.bool %}
|
||||
1
|
||||
{% else %}
|
||||
2
|
||||
{% endif %}
|
||||
description: if bool returns 1 otherwise return 2
|
||||
|
||||
int2:
|
||||
|
@ -16,5 +20,9 @@ int2:
|
|||
type: number
|
||||
default:
|
||||
jinja: >-
|
||||
{% if not rougail.bool %}3{% else %}4{% endif %}
|
||||
{% if not rougail.bool %}
|
||||
3
|
||||
{% else %}
|
||||
4
|
||||
{% endif %}
|
||||
description: if bool returns 3 otherwise return 4
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
leader:
|
||||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader: # a leader
|
||||
- value1
|
||||
- value2
|
||||
|
||||
follower1: val11 # a follower
|
||||
|
||||
follower2: val21 # an other follower
|
||||
|
||||
calculate:
|
||||
description: a calculated variable
|
||||
multi: true
|
||||
default:
|
||||
jinja: |-
|
||||
{{ _.leader.follower1[0] }}
|
||||
unique: false
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
leader:
|
||||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader: # a leader
|
||||
- value1
|
||||
- value2
|
||||
|
||||
follower1: val11 # a follower
|
||||
|
||||
follower2: val21 # an other follower
|
||||
|
||||
calculate:
|
||||
description: a calculated variable
|
||||
multi: true
|
||||
default:
|
||||
jinja: |-
|
||||
{{ _.leader.follower1[-1] }}
|
||||
unique: false
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
leader:
|
||||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader: # a leader
|
||||
- value1
|
||||
- value2
|
||||
|
||||
follower1: val11 # a follower
|
||||
|
||||
follower2: val21 # an other follower
|
||||
|
||||
calculate:
|
||||
description: a calculated variable
|
||||
multi: true
|
||||
default:
|
||||
variable: _.leader.follower1
|
||||
unique: false
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
leader:
|
||||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader: # a leader
|
||||
- value1
|
||||
- value2
|
||||
|
||||
follower1: val11 # a follower
|
||||
|
||||
follower2: val21 # an other follower
|
||||
|
||||
calculate:
|
||||
description: a calculated variable
|
||||
default:
|
||||
jinja: >-
|
||||
{{ _.leader.leader[0] }}
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
leader:
|
||||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader: # a leader
|
||||
- value1
|
||||
- value2
|
||||
|
||||
follower1: val11 # a follower
|
||||
|
||||
follower2: val21 # an other follower
|
||||
|
||||
calculate:
|
||||
description: a calculated variable
|
||||
default:
|
||||
jinja: >-
|
||||
{{ _.leader.leader[-1] }}
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
leader:
|
||||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader: # a leader
|
||||
- value1
|
||||
- value2
|
||||
|
||||
follower1: val11 # a follower
|
||||
|
||||
follower2: val21 # an other follower
|
||||
|
||||
calculate:
|
||||
description: a calculated variable
|
||||
default:
|
||||
variable: _.leader.leader
|
|
@ -15,6 +15,6 @@ leader:
|
|||
disabled:
|
||||
jinja: |-
|
||||
{% if rougail.condition == "yes" %}
|
||||
condition is yes
|
||||
condition is yes
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
|
|
@ -5,9 +5,7 @@ leader:
|
|||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader:
|
||||
description: a leader
|
||||
multi: true
|
||||
leader: [] # a leader
|
||||
|
||||
follower1:
|
||||
description: a follower
|
||||
|
|
|
@ -14,7 +14,7 @@ leader:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if __.condition == "no" %}
|
||||
condition is no
|
||||
condition is no
|
||||
{% endif %}
|
||||
description: if condition is no
|
||||
|
||||
|
|
|
@ -7,15 +7,13 @@ leader:
|
|||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader:
|
||||
description: a leader
|
||||
multi: true
|
||||
leader: [] # a leader
|
||||
|
||||
follower:
|
||||
description: a follower
|
||||
disabled:
|
||||
jinja: |-
|
||||
{% if __.condition == "yes" %}
|
||||
disabled
|
||||
disabled
|
||||
{% endif %}
|
||||
description: if condition is yes
|
||||
|
|
|
@ -16,6 +16,6 @@ leader:
|
|||
disabled:
|
||||
jinja: |-
|
||||
{% if _.leader == "a" %}
|
||||
the value of "leader" is "a"
|
||||
the value of "leader" is "a"
|
||||
{% endif %}
|
||||
description: if the value of "leader" is "a"
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var: # A suffix variable
|
||||
- val.1
|
||||
- val.2
|
||||
|
||||
dyn{{ identifier }}:
|
||||
description: A dynamic family
|
||||
dynamic:
|
||||
variable: _.var
|
||||
|
||||
var1:
|
||||
description: A dynamic variable
|
||||
default:
|
||||
type: identifier
|
||||
|
||||
var2:
|
||||
description: A dynamic variable
|
||||
default:
|
||||
jinja: >-
|
||||
{{ identifier }}
|
||||
params:
|
||||
identifier:
|
||||
type: identifier
|
|
@ -22,6 +22,6 @@ var2:
|
|||
default:
|
||||
jinja: >-
|
||||
{% if rougail.dyn1 is defined %}
|
||||
{{ rougail.dyn1.var }}
|
||||
{{ rougail.dyn1.var }}
|
||||
{% endif %}
|
||||
description: get the value of rougail.dyn1.var
|
||||
|
|
|
@ -10,7 +10,7 @@ dyn{{ identifier }}:
|
|||
dynamic:
|
||||
jinja: |-
|
||||
{% for val in _.var %}
|
||||
{{ loop.index }}
|
||||
{{ loop.index }}
|
||||
{% endfor %}
|
||||
description: index of suffix value
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ var2:
|
|||
default:
|
||||
jinja: >-
|
||||
{% if _.dynval1 is defined %}
|
||||
{{ _.dynval1.family.var }}
|
||||
{{ _.dynval1.family.var }}
|
||||
{% endif %}
|
||||
description: the value of var
|
||||
mandatory: false
|
||||
|
|
|
@ -23,7 +23,7 @@ var2:
|
|||
default:
|
||||
jinja: >-
|
||||
{% if _.dynval1 is defined %}
|
||||
{{ _.dynval1.family.var }}
|
||||
{{ _.dynval1.family.var }}
|
||||
{% endif %}
|
||||
description: the value of var
|
||||
mandatory: false
|
||||
|
|
|
@ -21,7 +21,7 @@ newvar:
|
|||
default:
|
||||
jinja: >-
|
||||
{% if _.dynval1 is defined %}
|
||||
{{ _.dynval1.var }}
|
||||
{{ _.dynval1.var }}
|
||||
{% endif %}
|
||||
description: the value of var
|
||||
mandatory: false
|
||||
|
|
|
@ -12,7 +12,7 @@ dyn{{ identifier }}:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if _.var2 == "no" %}
|
||||
var2 is no
|
||||
var2 is no
|
||||
{% endif %}
|
||||
description: if var2 is no
|
||||
dynamic:
|
||||
|
|
|
@ -16,7 +16,7 @@ dyn{{ identifier }}:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if _.var2 == "no" %}
|
||||
var2 is no
|
||||
var2 is no
|
||||
{% endif %}
|
||||
description: if var2 is no
|
||||
dynamic:
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var1:
|
||||
description: A suffix variable
|
||||
test:
|
||||
- val1
|
||||
multi: true
|
||||
mandatory: false
|
||||
|
||||
dyn{{ identifier }}:
|
||||
dynamic:
|
||||
variable: _.var1
|
||||
|
||||
var: # A dynamic variable
|
||||
|
||||
var2:
|
||||
description: A variable calculated
|
||||
default:
|
||||
variable: _.dynval1.var
|
||||
optional: true
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var2:
|
||||
description: A variable calculated
|
||||
default:
|
||||
variable: _.dynval1.var
|
||||
optional: true
|
||||
|
||||
var1:
|
||||
description: A suffix variable
|
||||
test:
|
||||
- val1
|
||||
- val2
|
||||
multi: true
|
||||
mandatory: false
|
||||
|
||||
dyn{{ identifier }}:
|
||||
dynamic:
|
||||
variable: _.var1
|
||||
|
||||
var: # A dynamic variable
|
|
@ -6,7 +6,7 @@ dyn{{ identifier }}:
|
|||
hidden:
|
||||
jinja: |-
|
||||
{% if suffix == 'val2' %}
|
||||
disabled
|
||||
disabled
|
||||
{% endif %}
|
||||
description: if suffix == 'val2'
|
||||
params:
|
||||
|
|
|
@ -39,5 +39,5 @@ var:
|
|||
disabled:
|
||||
jinja: |-
|
||||
{% if 'val4' not in __.var %}
|
||||
val4 is not a valid value
|
||||
val4 is not a valid value
|
||||
{% endif %}
|
||||
|
|
|
@ -38,5 +38,5 @@ var:
|
|||
disabled:
|
||||
jinja: |-
|
||||
{% if 'val4' not in __.var %}
|
||||
val4 is not a valid value
|
||||
val4 is not a valid value
|
||||
{% endif %}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
version: 1.1
|
||||
|
||||
var: # a suffix variable
|
||||
- val1
|
||||
- val2
|
||||
|
||||
my_dyn_family_{{ identifier }}:
|
||||
description: a dynamic family
|
||||
dynamic:
|
||||
variable: _.var
|
||||
propertyerror: false
|
||||
|
||||
var:
|
||||
description: a variable inside a dynamic family
|
||||
default:
|
||||
type: identifier
|
||||
mandatory: false
|
||||
|
||||
var2:
|
||||
description: a variable
|
||||
multi: true
|
||||
default:
|
||||
variable: _.my_dyn_family_{{ identifier }}.var
|
|
@ -22,7 +22,7 @@ var2:
|
|||
default:
|
||||
jinja: |-
|
||||
{%- for v in var %}
|
||||
{{ v }}
|
||||
{{ v }}
|
||||
{%- endfor -%}
|
||||
params:
|
||||
var:
|
||||
|
|
|
@ -26,7 +26,7 @@ var2:
|
|||
default:
|
||||
jinja: |-
|
||||
{%- for v in var %}
|
||||
{{ v }}
|
||||
{{ v }}
|
||||
{%- endfor -%}
|
||||
params:
|
||||
var:
|
||||
|
|
|
@ -14,9 +14,7 @@ dyn{{ identifier }}:
|
|||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader:
|
||||
description: a leader
|
||||
multi: true
|
||||
leader: [] # a leader
|
||||
|
||||
follower1:
|
||||
description: a follower1
|
||||
|
|
|
@ -18,9 +18,7 @@ dyn{{ identifier }}:
|
|||
description: a leadership
|
||||
type: leadership
|
||||
|
||||
leader:
|
||||
description: a leader
|
||||
multi: true
|
||||
leader: [] # a leader
|
||||
|
||||
follower1:
|
||||
description: a follower1
|
||||
|
|
|
@ -16,7 +16,7 @@ dyn{{ identifier }}:
|
|||
default:
|
||||
jinja: |-
|
||||
{% for val in __.var %}
|
||||
t{{ val }}
|
||||
t{{ val }}
|
||||
{% endfor %}
|
||||
description: add 't' to each var value
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ dyn{{ identifier }}:
|
|||
default:
|
||||
jinja: |-
|
||||
{% for val in rougail.var %}
|
||||
t{{ val }}
|
||||
t{{ val }}
|
||||
{% endfor %}
|
||||
description: add 't' to each var value
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ dyn{{ identifier }}:
|
|||
default:
|
||||
jinja: |-
|
||||
{% for val in __.var %}
|
||||
t{{ val }}
|
||||
t{{ val }}
|
||||
{% endfor %}
|
||||
description: add 't' to each var value
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@ from rougail_tests.utils import get_structures_list, get_rougail_config, config_
|
|||
|
||||
|
||||
excludes = [
|
||||
# "24_0family_hidden_condition_sub_family",
|
||||
# "16_6exists_family",
|
||||
]
|
||||
|
||||
test_ok = get_structures_list(excludes)
|
||||
# test_ok = [Path('../rougail-tests/structures/20_9family_absolute')]
|
||||
# test_ok = [Path('../rougail-tests/structures/00_7help')]
|
||||
|
||||
|
||||
def idfn(fixture_value):
|
||||
|
@ -32,7 +32,7 @@ def _test_structural_files(file_name, namespace, rougailconfig):
|
|||
rougailconfig['step.output'] = 'formatter'
|
||||
##################################
|
||||
config = None
|
||||
generated_output = RougailOutput(config, rougailconfig=rougailconfig).run()
|
||||
generated_output = RougailOutput(config, rougailconfig=rougailconfig).run()[1] + '\n'
|
||||
output_file = get_output_director(namespace) / file_name.parent.parent.name / file_name.parent.name / file_name.name
|
||||
if not output_file.is_file():
|
||||
if not output_file.parent.is_dir():
|
||||
|
|
Loading…
Reference in a new issue