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

Treat warnings as errors in doc building action #61

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

sfmig
Copy link
Contributor

@sfmig sfmig commented Aug 13, 2024

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
On issue #252, @lochhh pointed out that sphinx-build returns a successful exit code (0) even if it encountered errors.

This can be quite annoying: in practice it means we need to remember to manually check the logs of the action (or locally), to confirm that there were no errors, even if the action shows a pass.

The simplest workaround seems to add the flags -W --keep-going so that sphinx-build runs to completion, treats warnings as errors, and returns a non-zero exit code if there are errors or warnings.

What does this PR do?
Adds the flags -W --keep-going to the sphinx-build in the doc building workflow file.

References

In movement we build the docs in CI using make, and have a PR to add the -W --keep-going to the makefile:

  • issue #252.
  • PR #256, where we added this flags to the Makefile.

How has this PR been tested?

I have checked that the syntax of the sphinx-build command works locally as expected. I am not sure how to test this further.

Is this a breaking change?

I think no.

Does this PR require an update to the documentation?

AFAIK this is not documented beyond the workflow file itself.

Checklist:

  • [ n/a ] The code has been tested locally
  • [ n/a ] Tests have been added to cover all new functionality
  • [ n/a ] The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

Add flags to `sphinx-build` command to treat warnings as errors.
@sfmig sfmig changed the title Update doc building action Treat warnings as errors in doc building action Aug 13, 2024
@sfmig sfmig requested a review from a team August 13, 2024 12:06
@sfmig sfmig marked this pull request as ready for review August 13, 2024 12:06
@adamltyson adamltyson merged commit 7165b6a into main Aug 29, 2024
@adamltyson adamltyson deleted the smg/sphinx-build-flags branch August 29, 2024 14:07
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