Skip to content

Commit

Permalink
Do extra docs validation; explicitly disallow semantic markup in docs (
Browse files Browse the repository at this point in the history
…#165) (#167)

* Do extra docs validation. Explicitly disallow semantic markup in docs.

* Forgot to add new requirement.

* Improve test.

* TEMP - make CI fail.

* Remove unnecessary import.

* Make sure ANSIBLE_COLLECTIONS_PATH is set.

* Revert "TEMP - make CI fail."

This reverts commit 445c56e.

* Make sure sanity tests from older Ansible versions don't complain.

(cherry picked from commit dd1e48c)

Co-authored-by: Felix Fontein <[email protected]>
  • Loading branch information
patchback[bot] and felixfontein authored Apr 16, 2023
1 parent 8d4ba59 commit 3ab4c8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion tests/sanity/extra/extra-docs.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"include_symlinks": false,
"prefixes": [
"docs/docsite/"
"docs/docsite/",
"plugins/",
"roles/"
],
"output": "path-line-column-message",
"requirements": [
"ansible-core",
"antsibull-docs"
]
}
11 changes: 8 additions & 3 deletions tests/sanity/extra/extra-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@

def main():
"""Main entry point."""
if not os.path.isdir(os.path.join('docs', 'docsite')):
return
p = subprocess.run(['antsibull-docs', 'lint-collection-docs', '.'], check=False)
env = os.environ.copy()
suffix = ':{env}'.format(env=env["ANSIBLE_COLLECTIONS_PATH"]) if 'ANSIBLE_COLLECTIONS_PATH' in env else ''
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):
print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode))

Expand Down

0 comments on commit 3ab4c8d

Please sign in to comment.