mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-01 22:09:08 -07:00
Issues with pre-existing docs should not cause errors, only warnings
This commit is contained in:
parent
aeb064520e
commit
d777e217e7
1 changed files with 12 additions and 7 deletions
|
@ -72,6 +72,7 @@ class Validator(object):
|
||||||
self.errors = []
|
self.errors = []
|
||||||
self.warnings = []
|
self.warnings = []
|
||||||
self.traces = []
|
self.traces = []
|
||||||
|
self.warning_traces = []
|
||||||
|
|
||||||
@abc.abstractproperty
|
@abc.abstractproperty
|
||||||
def object_name(self):
|
def object_name(self):
|
||||||
|
@ -98,7 +99,11 @@ class Validator(object):
|
||||||
|
|
||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
for trace in self.traces:
|
traces = self.traces[:]
|
||||||
|
if warnings and self.warnings:
|
||||||
|
traces.extend(self.warning_traces)
|
||||||
|
|
||||||
|
for trace in traces:
|
||||||
print('TRACE:')
|
print('TRACE:')
|
||||||
print('\n '.join((' %s' % trace).splitlines()))
|
print('\n '.join((' %s' % trace).splitlines()))
|
||||||
for error in self.errors:
|
for error in self.errors:
|
||||||
|
@ -225,7 +230,6 @@ class ModuleValidator(Validator):
|
||||||
elif not new_only:
|
elif not new_only:
|
||||||
self.errors.append(msg)
|
self.errors.append(msg)
|
||||||
|
|
||||||
|
|
||||||
def _find_module_utils(self, main):
|
def _find_module_utils(self, main):
|
||||||
linenos = []
|
linenos = []
|
||||||
found_basic = False
|
found_basic = False
|
||||||
|
@ -468,13 +472,14 @@ class ModuleValidator(Validator):
|
||||||
existing_options = existing_doc.get('options', {})
|
existing_options = existing_doc.get('options', {})
|
||||||
except AssertionError:
|
except AssertionError:
|
||||||
fragment = doc['extends_documentation_fragment']
|
fragment = doc['extends_documentation_fragment']
|
||||||
self.errors.append('Existing DOCUMENTATION fragment missing: '
|
self.warnings.append('Pre-existing DOCUMENTATION fragment '
|
||||||
'%s' % fragment)
|
'missing: %s' % fragment)
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.traces.append(e)
|
self.warning_traces.append(e)
|
||||||
self.errors.append('Unknown existing DOCUMENTATION error, see '
|
self.warnings.append('Unknown pre-existing DOCUMENTATION '
|
||||||
'TRACE')
|
'error, see TRACE. Submodule refs may '
|
||||||
|
'need updated')
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue