Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx extension: log build errors next to emitting error markup #187

Merged
merged 4 commits into from
Jul 9, 2023

Conversation

felixfontein
Copy link
Collaborator

@felixfontein felixfontein commented Jul 8, 2023

So far, when the roles in the Sphinx extension were used with bad data, only error markup was generated, but no log output was printed during the build.

Example input:

[...]

:ansplugin:`foo.bar.baz`
:ansopt:`foo.bar.baz:bam`

:ansretval:`foo.bar.baz#bamboo`
:ansplugin:`foo.bar.baz#module`

[...]

Example output:

[..]
reading sources... [100%] index
/path/to/index.rst:7: ERROR: while processing :ansplugin:`foo.bar.baz`: Cannot extract plugin name and type
/path/to/index.rst:7: ERROR: while processing :ansopt:`foo.bar.baz:bam`: Invalid option name "foo.bar.baz:bam"
/path/to/index.rst:10: ERROR: while processing :ansretval:`foo.bar.baz#bamboo`: Invalid return value name "foo.bar.baz#bamboo"
looking for now-outdated files... none found
[...]
writing output... [100%] index
/path/to/index.rst:10: WARNING: undefined label: 'ansible_collections.foo.bar.baz_module'
generating indices... done
[...]

(The undefined label warning was already printed before when Sphinx tries to resolve the reference. What's new are the errors printed while processing the sources.)

changelogs/fragments/187-role-errors.yml Outdated Show resolved Hide resolved
Co-authored-by: Maxwell G <maxwell@gtmx.me>
@felixfontein felixfontein merged commit 3d3d4d3 into ansible-community:main Jul 9, 2023
@felixfontein felixfontein deleted the warn branch July 9, 2023 18:59
@gotmax23
Copy link
Collaborator

gotmax23 commented Jul 9, 2023

Thanks for working on this!

@felixfontein
Copy link
Collaborator Author

@gotmax23 thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants