Skip to content

Commit ee8c6ce

Browse files
authored
Do extra docs validation; explicitly disallow semantic markup in docs (#140)
* Do extra docs validation. Explicitly disallow semantic markup in docs. * Forgot to add new requirement. * Improve test. * TEMP - make CI fail. * Revert "TEMP - make CI fail." This reverts commit 8e2c20f. * Remove unnecessary import. * Make sure ANSIBLE_COLLECTIONS_PATH is set. * Make sure sanity tests from older Ansible versions don't complain.
1 parent e60bcc1 commit ee8c6ce

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

tests/sanity/extra/extra-docs.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"include_symlinks": false,
33
"prefixes": [
4-
"docs/docsite/"
4+
"docs/docsite/",
5+
"plugins/",
6+
"roles/"
57
],
68
"output": "path-line-column-message",
79
"requirements": [
10+
"ansible-core",
811
"antsibull-docs"
912
]
1013
}

tests/sanity/extra/extra-docs.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@
1313

1414
def main():
1515
"""Main entry point."""
16-
if not os.path.isdir(os.path.join('docs', 'docsite')):
17-
return
18-
p = subprocess.run(['antsibull-docs', 'lint-collection-docs', '.'], check=False)
16+
env = os.environ.copy()
17+
suffix = ':{env}'.format(env=env["ANSIBLE_COLLECTIONS_PATH"]) if 'ANSIBLE_COLLECTIONS_PATH' in env else ''
18+
env['ANSIBLE_COLLECTIONS_PATH'] = '{root}{suffix}'.format(root=os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))), suffix=suffix)
19+
p = subprocess.run(
20+
['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--disallow-semantic-markup', '--skip-rstcheck', '.'],
21+
env=env,
22+
check=False,
23+
)
1924
if p.returncode not in (0, 3):
2025
print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode))
2126

0 commit comments

Comments
 (0)