Skip to content

Add escalation of warnings to errors in the build of the Sphinx docs.#155

Merged
mo-lucy-gordon merged 6 commits intoMetOffice:mainfrom
andrewcoughtrie:sphinx_warnings_as_errors
Aug 28, 2025
Merged

Add escalation of warnings to errors in the build of the Sphinx docs.#155
mo-lucy-gordon merged 6 commits intoMetOffice:mainfrom
andrewcoughtrie:sphinx_warnings_as_errors

Conversation

@andrewcoughtrie
Copy link
Copy Markdown
Collaborator

@andrewcoughtrie Andrew Coughtrie (andrewcoughtrie) commented Aug 27, 2025

Description

I've added flags to the build-docs workflow to catch build warnings produced by the Sphinx build. The flags do the following:

Flag Purpose
-W Turn warnings into errors.
--keep-going Run to completion and exits with exit status 1 if errors are encountered.
-n Run in nitpicky mode. Currently, this generates warnings for all missing references

There is also a small fix to the workflow syntax to make sure the branch checked out by the workflow is the submitting ref (e.g. the branch for the PR or main on merge)

Linked issues

Closes #154

Developer tags

Type of change

  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • This change requires a documentation update.

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

  • New tests have been added.
  • Tests have been modified to accommodate this change.
  • GitHub workflows have been changed or added.

Checklist:

  • The change has been checked for design compliance by an experienced SSE
  • My code follows the style guidelines of this project.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes, for both debug and optimised builds.
  • No AI tools have been used in the creation of this change.

Reasoning on why any of the above boxes have not been checked

Review Checks (To be filled in by the reviewer/s)

  • Has the developer completed the appropriate sections above?
  • Is the change compliant with LFRic Core principles?
  • Is the testing coverage sufficient?
  • Have any technical debt workarounds identified had issues opened and interested parties notified?

@andrewcoughtrie Andrew Coughtrie (andrewcoughtrie) added the enhancement New feature or request label Aug 27, 2025
Copy link
Copy Markdown
Contributor

@mo-lucy-gordon mo-lucy-gordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good change, can't see any issues

@mo-lucy-gordon mo-lucy-gordon merged commit dc8ebc3 into MetOffice:main Aug 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sphinx warnings as errors on workflow builds

2 participants