remove unnecessary newlines in templates (#537)

This commit is contained in:
Robert Kaussow 2023-08-09 09:46:15 +02:00 committed by GitHub
parent aa29881542
commit a4a497ca4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 18 additions and 18 deletions

View File

@ -75,6 +75,8 @@ class Parser:
)
def _parse_meta_file(self):
self._data["meta"]["name"] = {"value": self.config.config["role_name"]}
for rfile in self._files_registry.get_files():
if any("meta/main." + ext in rfile for ext in YAML_EXTENSIONS):
with open(rfile, encoding="utf8") as yaml_file:
@ -91,8 +93,6 @@ class Parser:
self._data["meta"]["dependencies"] = {
"value": data.get("dependencies")
}
self._data["meta"]["name"] = {"value": self.config.config["role_name"]}
except (
ruamel.yaml.composer.ComposerError, ruamel.yaml.scanner.ScannerError
) as e:

View File

@ -1,4 +1,3 @@
## Requirements
{% if meta | deep_get(meta, "min_ansible_version.value") %}

View File

@ -1,6 +1,5 @@
{% set var = role.var | default({}) %}
{% if var %}
## Default Variables
{% for key, item in var | dictsort %}
@ -15,7 +14,6 @@
{% if item.deprecated is defined %}
{% set deprecated = [item.deprecated] if item.deprecated is string else item.deprecated %}
{% set deprecated_string = deprecated | map("replace", "\n\n", "\n") | safe_join("\n") %}
{% if deprecated_string %}
**_Deprecated:_** {{ deprecated_string }}<br />
{% else %}

View File

@ -17,7 +17,7 @@ summary: {{ meta.summary.value | safe_join(" ") }}
<!--more-->
{# TOC #}
{% include '_toc.j2' %}
{% include '_toc.j2' +%}
{# Requirements #}
{% include '_requirements.j2' %}

View File

@ -9,7 +9,7 @@
{% endif %}
{# TOC #}
{% include '_toc.j2' %}
{% include '_toc.j2' +%}
{# Requirements #}
{% include '_requirements.j2' %}

View File

@ -1,4 +1,3 @@
## Requirements
{% if meta | deep_get(meta, "min_ansible_version.value") %}

View File

@ -1,6 +1,5 @@
{% set var = role.var | default({}) %}
{% if var %}
## Default Variables
{% for key, item in var | dictsort %}
@ -15,7 +14,6 @@
{% if item.deprecated is defined %}
{% set deprecated = [item.deprecated] if item.deprecated is string else item.deprecated %}
{% set deprecated_string = deprecated | map("replace", "\n\n", "\n") | safe_join("\n") %}
{% if deprecated_string %}
**_Deprecated:_** {{ deprecated_string }}<br />
{% else %}

View File

@ -31,14 +31,12 @@ the default description with an annotation.
## Requirements
- Minimum Ansible version: `2.4`
- Minimum Ansible version: `2.10`
## Default Variables
### demo_role_deprecated
**_Deprecated_**<br />
#### Default value
@ -49,7 +47,6 @@ demo_role_deprecated: b
### demo_role_deprecated_info
**_Deprecated:_** This variable is deprected since `v2.0.0` and will be removed in a future release.<br />
**_Type:_** string<br />

View File

@ -8,14 +8,16 @@ galaxy_info:
description: Role to demonstrate ansible-doctor.
author: John Doe
license: MIT
min_ansible_version: 2.4
min_ansible_version: "2.10"
platforms:
- name: EL
versions:
- 7
- "9"
galaxy_tags:
- demo
- documentation
dependencies:
- role1
- role: role2
- name: namespace.role3

View File

@ -7,6 +7,7 @@ Role to demonstrate ansible-doctor.
## Table of content
- [Requirements](#requirements)
- [Default Variables](#default-variables)
- [demo_role_unset](#demo_role_unset)
- [Discovered Tags](#discovered-tags)
@ -17,6 +18,10 @@ Role to demonstrate ansible-doctor.
---
## Requirements
- Minimum Ansible version: `2.10`
## Default Variables
### demo_role_unset

View File

@ -4,14 +4,16 @@ galaxy_info:
description: Role to demonstrate ansible-doctor.
author: John Doe
license: MIT
min_ansible_version: 2.4
min_ansible_version: "2.10"
platforms:
- name: EL
versions:
- 7
- "9"
galaxy_tags:
- demo
- documentation
dependencies:
- role1
- role: role2
- name: namespace.role3