better error message for malformed documentation (#84705)

No the file name that caused the error will be apparent
---------

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Abhijeet Kasurde <Akasurde@redhat.com>
This commit is contained in:
simonLeary42
2025-02-17 16:12:14 -05:00
committed by GitHub
co-authored by Abhijeet Kasurde
parent cc30f25c42
commit 55e9e21ded
4 changed files with 33 additions and 1 deletions
@@ -0,0 +1,16 @@
# Copyright (c) 2022 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import annotations
DOCUMENTATION = """
name: broken_docs
-
"""
EXAMPLE = """
"""
RETURN = """
"""
@@ -181,3 +181,13 @@
- '"[DEPRECATION WARNING]" in result.stderr'
- '"deprecated_with_adj_docs " in result.stdout'
- '"AUTHOR: Ansible Core Team" in result.stdout'
- name: Handle plugin docs
debug:
msg: "{{ lookup('broken_docs') }}"
register: r
ignore_errors: yes
- assert:
that:
- "'plugin broken_docs has malformed documentation' in r.msg"