mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
If there are no DOCs provided at all, don't traceback, skip the _ensure_imports_below_docs test (#25621)
This commit is contained in:
@@ -542,9 +542,14 @@ class ModuleValidator(Validator):
|
||||
)
|
||||
|
||||
def _ensure_imports_below_docs(self, doc_info, first_callable):
|
||||
min_doc_line = min(
|
||||
[doc_info[key]['lineno'] for key in doc_info if doc_info[key]['lineno']]
|
||||
)
|
||||
try:
|
||||
min_doc_line = min(
|
||||
[doc_info[key]['lineno'] for key in doc_info if doc_info[key]['lineno']]
|
||||
)
|
||||
except ValueError:
|
||||
# We can't perform this validation, as there are no DOCs provided at all
|
||||
return
|
||||
|
||||
max_doc_line = max(
|
||||
[doc_info[key]['end_lineno'] for key in doc_info if doc_info[key]['end_lineno']]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user