-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Merge error code lists into one page (Fixes #20077) #20559
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
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
This comment has been minimized.
This comment has been minimized.
|
You've accidentally included the changes from #20560 in this PR as well. |
docs/source/conf.py
Outdated
| "build", | ||
| "Thumbs.db", | ||
| ".DS_Store", | ||
| "error_code_list.rst", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these necessary for some reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I originally added them here to silence the [toc.not_included] warnings, but I realize now that exclude_patterns prevents the redirect HTML files from being built entirely.
I will revert this change and instead add the :orphan: metadata to the top of the .rst files. That should silence the warning while still generating the redirects.
|
This would supercede and thus close #20377 |
This comment has been minimized.
This comment has been minimized.
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
This PR addresses issue #20077 by merging the split error code documentation (error_code_list.rst and error_code_list2.rst) into a single, comprehensive reference page: error_codes.rst.
Previously, users had to know whether an error code was enabled or disabled by default to find its documentation. This merge centralizes all error codes and explicitly states their default status, improving discoverability and usability.
Changes Made
Content Merge: Moved all content from error_code_list.rst (enabled codes) and error_code_list2.rst (optional codes) into error_codes.rst.
Explicit Enablement Notes: Added specific .. note:: blocks to every error code entry.
Codes in the first section are marked as "Enabled by default."
Codes in the optional section are marked as "Disabled by default," including instructions on which CLI flag enables them (e.g., Use --disallow-untyped-defs to enable it).
Cleanup: Removed duplicate headers and fixed header syntax errors introduced during the merge.
TOC Update: Updated docs/source/index.rst to remove references to the deleted files.
Redirects: Replaced the old files (error_code_list.rst and error_code_list2.rst) with stub files containing :orchestrate_redirect: directives to preserve existing links and bookmarks.
Test Plan
I have built the documentation locally using Sphinx (python -m sphinx -b html docs/source docs/build/html) and verified that:
The error_codes.html page renders correctly with all codes present.
The Table of Contents in the sidebar is correct.
The notes regarding enabled/disabled status appear correctly for each item.
Fixes #20077