[PR #6345/ee11847c backport][stable-5] Do extra docs validation; explicitly disallow semantic markup in docs (#6349)
Do extra docs validation; explicitly disallow semantic markup in docs (#6345) * Do extra docs validation. Explicitly disallow semantic markup in docs. * Forgot to add new requirement. * Fix prefixes. * Remove superfluous condition. * TEMP - make CI fail. * Revert "TEMP - make CI fail." This reverts commitpull/6371/head14f4d6b503
. * Remove unnecessary import. * Make sure ANSIBLE_COLLECTIONS_PATH is set. * Make sure sanity tests from older Ansible versions don't complain. (cherry picked from commitee11847c7e
) Co-authored-by: Felix Fontein <felix@fontein.de>
parent
72b282fe85
commit
fd2528dc3c
|
@ -1,10 +1,13 @@
|
||||||
{
|
{
|
||||||
"include_symlinks": false,
|
"include_symlinks": false,
|
||||||
"prefixes": [
|
"prefixes": [
|
||||||
"docs/docsite/"
|
"docs/docsite/",
|
||||||
|
"plugins/",
|
||||||
|
"roles/"
|
||||||
],
|
],
|
||||||
"output": "path-line-column-message",
|
"output": "path-line-column-message",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
|
"ansible-core",
|
||||||
"antsibull-docs"
|
"antsibull-docs"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,14 @@ import subprocess
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main entry point."""
|
"""Main entry point."""
|
||||||
if not os.path.isdir(os.path.join('docs', 'docsite')):
|
env = os.environ.copy()
|
||||||
return
|
suffix = ':{env}'.format(env=env["ANSIBLE_COLLECTIONS_PATH"]) if 'ANSIBLE_COLLECTIONS_PATH' in env else ''
|
||||||
p = subprocess.run(['antsibull-docs', 'lint-collection-docs', '.'], check=False)
|
env['ANSIBLE_COLLECTIONS_PATH'] = '{root}{suffix}'.format(root=os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))), suffix=suffix)
|
||||||
|
p = subprocess.run(
|
||||||
|
['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--disallow-semantic-markup', '--skip-rstcheck', '.'],
|
||||||
|
env=env,
|
||||||
|
check=False,
|
||||||
|
)
|
||||||
if p.returncode not in (0, 3):
|
if p.returncode not in (0, 3):
|
||||||
print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode))
|
print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue