fix: fix syntax issue in annotation parser (#725)

This commit is contained in:
Robert Kaussow 2024-06-22 20:49:16 +02:00 committed by GitHub
parent 951f4394da
commit f1bd734498
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 4 deletions

View File

@ -10,3 +10,4 @@ ansible-.+
toc toc
GPL-3.0 GPL-3.0
(P|p)re-(C|c)ommit (P|p)re-(C|c)ommit
JSON

View File

@ -119,7 +119,7 @@ class Annotation:
if parts[2] not in multiline_char and parts[2].startswith("$"): if parts[2] not in multiline_char and parts[2].startswith("$"):
source = parts[2].replace("$", "").strip() source = parts[2].replace("$", "").strip()
content = self._str_to_json(key, source, rfile, num, line) content = self._str_to_json(key, source, rfile, num)
item.data[key][parts[1]] = content item.data[key][parts[1]] = content

View File

@ -74,7 +74,7 @@ class Parser:
tags = [] tags = []
for task in raw: for task in raw:
task_tags = task.get("tags") task_tags = task.get("tags", [])
if isinstance(task_tags, str): if isinstance(task_tags, str):
task_tags = [task_tags] task_tags = [task_tags]

View File

@ -127,11 +127,15 @@ options:
## Environment Variables ## Environment Variables
{{< hint type=note >}}
List configuration options need to be passed as JSON strings.
{{< /hint >}}
```Shell ```Shell
ANSIBLE_DOCTOR_BASE_DIR= ANSIBLE_DOCTOR_BASE_DIR=
ANSIBLE_DOCTOR_DRY_RUN=False ANSIBLE_DOCTOR_DRY_RUN=False
ANSIBLE_DOCTOR_EXCLUDE_FILES= ANSIBLE_DOCTOR_EXCLUDE_FILES="['molecule/']"
ANSIBLE_DOCTOR_EXCLUDE_TAGS= ANSIBLE_DOCTOR_EXCLUDE_TAGS="[]"
ANSIBLE_DOCTOR_ROLE__NAME= ANSIBLE_DOCTOR_ROLE__NAME=
ANSIBLE_DOCTOR_ROLE__AUTODETECT=True ANSIBLE_DOCTOR_ROLE__AUTODETECT=True