Skip to content

Conversation

@daksh1403
Copy link

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

@github-actions

This comment has been minimized.

@wyattscarpenter
Copy link
Contributor

You've accidentally included the changes from #20560 in this PR as well.

"build",
"Thumbs.db",
".DS_Store",
"error_code_list.rst",
Copy link
Contributor

@wyattscarpenter wyattscarpenter Jan 11, 2026

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?

Copy link
Author

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.

@wyattscarpenter
Copy link
Contributor

This would supercede and thus close #20377

@github-actions

This comment has been minimized.

@daksh1403 daksh1403 closed this Jan 11, 2026
@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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.

[docs] merge error code lists

2 participants