Skip to content

Commit

Permalink
More informative error when someone adds a module without updating th…
Browse files Browse the repository at this point in the history
…e corresponding rst file (pytorch#1653)

Summary:
Pull Request resolved: pytorch#1653

A couple OSS users who have managed to get every other check passing have run into this error, and it isn't clear how to fix it without reading the source code. Example: https://github.com/pytorch/botorch/actions/runs/4084789012/jobs/7041911357

Reviewed By: Balandat

Differential Revision: D43001050

fbshipit-source-id: d211c58fea5c987f947e23716e538cddce022340
  • Loading branch information
esantorella authored and facebook-github-bot committed Feb 3, 2023
1 parent 7e1350b commit d026e80
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/validate_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ def validate_complete_sphinx(path_to_botorch: str) -> None:
# Verify that all top-level modules have a corresponding rst
missing_rsts = modules.difference(rsts)
if not len(missing_rsts) == 0:
raise RuntimeError(f"Not all modules have corresponding rst: {missing_rsts}")
raise RuntimeError(
f"""Not all modules have corresponding rst:
{missing_rsts}
Please add them to the appropriate rst file in {SPHINX_RST_PATH}.
"""
)

# Track all modules that are not in docs (so can print all)
modules_not_in_docs = []
Expand Down

0 comments on commit d026e80

Please sign in to comment.