Skip to content

[pull] master from sphinx-doc:master #50

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

Open
wants to merge 92 commits into
base: master
Choose a base branch
from

Conversation

pull[bot]
Copy link

@pull pull bot commented Mar 20, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

This PR addresses several minor issues across different modules, primarily focusing on removing unused variables and updating a dependency version.

Chores:

  • Remove unused variables in several test functions and domain methods.
  • Update ruff dependency to version 0.11.0.

@pull pull bot added the ⤵️ pull label Mar 20, 2025
Copy link

google-cla bot commented Mar 20, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

sourcery-ai bot commented Mar 20, 2025

Reviewer's Guide by Sourcery

This pull request focuses on removing unused variables throughout the Sphinx codebase and updating the ruff dependency. The changes improve code readability, maintainability, and reduce potential errors. The ruff dependency has been updated to version 0.11.0.

Updated class diagram for AutoDirective

classDiagram
    class AutoDirective {
        +parse_name()
        +resolve_name()
        +_find_signature()
        +should_suppress_value_header()
    }
    note for AutoDirective "Unused variable `tp_list` removed from `parse_name` and `_find_signature` methods."
    note for AutoDirective "Unused variable `sep` removed from `resolve_name` method."
    note for AutoDirective "Unused variable `docstring` removed from `should_suppress_value_header` method."
Loading

Updated class diagram for ImageMath

classDiagram
    class ImageMath {
        +convert_dvi_to_png()
        +convert_dvi_to_svg()
        +html_visit_displaymath()
    }
    note for ImageMath "Unused variable `stderr` removed from `convert_dvi_to_svg` method."
    note for ImageMath "Unused variable `depth` removed from `html_visit_displaymath` method."
Loading

Updated class diagram for Viewcode

classDiagram
    class Viewcode {
        +env_purge_doc()
        +get_module_filename()
        +collect_pages()
    }
    note for Viewcode "Unused variable `code` and `refname` removed from `env_purge_doc` method."
    note for Viewcode "Unused variable `source` removed from `get_module_filename` method."
    note for Viewcode "Unused variable `type` removed from `collect_pages` method."
Loading

Updated class diagram for Graphviz

classDiagram
    class Graphviz {
        +render_dot_latex()
        +render_dot_texinfo()
    }
    note for Graphviz "Unused variable `outfn` removed from `render_dot_latex` and `render_dot_texinfo` methods."
Loading

Updated class diagram for Include

classDiagram
    class Include {
        +run()
    }
    note for Include "Unused variable `rel_filename` removed from `run` method."
Loading

Updated class diagram for CParser

classDiagram
    class CParser {
        +_parse_paren_expression_list()
    }
    note for CParser "Unused variable `trailing_comma` removed from `_parse_paren_expression_list` method."
Loading

Updated class diagram for CitationDomain

classDiagram
    class CitationDomain {
        +resolve_xref()
    }
    note for CitationDomain "Unused variable `lineno` removed from `resolve_xref` method."
Loading

Updated class diagram for CPPParser

classDiagram
    class CPPParser {
        +_parse_paren_expression_list()
    }
    note for CPPParser "Unused variable `trailing_comma` removed from `_parse_paren_expression_list` method."
Loading

Updated class diagram for IndexEntries

classDiagram
    class IndexEntries {
        +_group_by_func()
    }
    note for IndexEntries "Unused variable `targets` and `sub_items` removed from `_group_by_func` method."
Loading

Updated class diagram for Asset

classDiagram
    class Asset {
        +collect_candidates()
    }
    note for Asset "Unused variable `basename` removed from `collect_candidates` method."
Loading

Updated class diagram for AutoSummary

classDiagram
    class AutoSummary {
        +import_ivar_by_name()
        +find_autosummary_in_docstring()
    }
    note for AutoSummary "Unused variable `parent` removed from `import_ivar_by_name` method."
    note for AutoSummary "Unused variable `real_name` and `parent` and `modname` removed from `find_autosummary_in_docstring` method."
Loading

Updated class diagram for InheritanceDiagram

classDiagram
    class InheritanceDiagram {
        +run()
    }
    note for InheritanceDiagram "Unused variable `x` removed from `run` method."
Loading

Updated class diagram for Napoleon

classDiagram
    class Napoleon {
        +_consume_field()
    }
    note for Napoleon "Unused variable `colon` removed from `_consume_field` method."
Loading

Updated class diagram for Texinfo

classDiagram
    class Texinfo {
        +visit_footnote_reference()
    }
    note for Texinfo "Unused variable `used` removed from `visit_footnote_reference` method."
Loading

File-Level Changes

Change Details Files
Removed unused variables in LiteralIncludeReader.read() method within the test suite. This simplifies the code and reduces potential confusion.
  • Replaced lines with _lines in test_LiteralIncludeReader_pyobject1
  • Replaced lines with _lines in test_LiteralIncludeReader_pyobject2
  • Replaced lines with _lines in test_LiteralIncludeReader_pyobject3
  • Replaced lines with _lines in test_LiteralIncludeReader_pyobject_and_lines
  • Replaced lines with _lines in test_LiteralIncludeReader_lines1
  • Replaced lines with _lines in test_LiteralIncludeReader_lines2
  • Replaced lines with _lines in test_LiteralIncludeReader_lines_and_lineno_match1
  • Replaced lines with _lines in test_LiteralIncludeReader_start_at
  • Replaced lines with _lines in test_LiteralIncludeReader_start_after
  • Replaced lines with _lines in test_LiteralIncludeReader_start_after_and_lines
  • Replaced lines with _lines in test_LiteralIncludeReader_start_at_and_lines
  • Replaced lines with _lines in test_LiteralIncludeReader_missing_start_and_end
  • Replaced lines with _lines in test_LiteralIncludeReader_end_before
  • Replaced lines with _lines in test_LiteralIncludeReader_prepend
  • Replaced lines with _lines in test_LiteralIncludeReader_dedent
  • Replaced lines with _lines in test_LiteralIncludeReader_dedent_and_append_and_prepend
  • Replaced lines with _lines in test_LiteralIncludeReader_tabwidth
  • Replaced lines with _lines in test_LiteralIncludeReader_tabwidth_dedent
  • Replaced lines with _lines in test_LiteralIncludeReader_diff
tests/test_directives/test_directive_code.py
Unused variables have been removed in multiple methods across different Python domain classes. This enhances code readability and maintainability.
  • Replaced cls with _cls in add_target_and_index
  • Replaced cls with _cls in get_index_text (multiple occurrences)
  • Replaced exmod with _exmod and tp_list with _tp_list in _find_signature
  • Replaced sep with _sep in resolve_name
sphinx/domains/python/__init__.py
sphinx/ext/autodoc/__init__.py
Unused variables have been removed from the imgmath extension. This improves code clarity and reduces potential errors.
  • Replaced stderr with _stderr in convert_dvi_to_png
  • Replaced stdout with _stdout in convert_dvi_to_svg
  • Replaced depth with _depth in html_visit_displaymath
sphinx/ext/imgmath.py
Unused variables have been removed in the viewcode extension. This simplifies the code and makes it easier to understand.
  • Replaced code and tags with _code and _tags in env_purge_doc
  • Replaced source with _source in get_module_filename
  • Replaced type with _type in collect_pages
sphinx/ext/viewcode.py
Unused variables have been removed in the intersphinx_cache test suite. This cleans up the test code and reduces potential confusion.
  • Replaced e_time with _e_time in test_load_mappings_cache
  • Replaced e_time with _e_time in test_load_mappings_cache_update
  • Replaced e_time with _e_time in test_load_mappings_cache_revert_update
tests/test_extensions/test_ext_intersphinx_cache.py
Conditional logic has been updated in test_util_typing.py to accurately reflect version-specific behavior.
  • Changed version check from >= (3, 13) to == (3, 13)
  • Changed version check from < (3, 13) to != (3, 13)
tests/test_util/test_util_typing.py
Unused variables have been removed in the graphviz extension. This improves code clarity and reduces potential errors.
  • Replaced outfn with _outfn in render_dot_latex
  • Replaced outfn with _outfn in render_dot_texinfo
sphinx/ext/graphviz.py
Unused variables have been removed in the linkcheck test suite. This cleans up the test code and reduces potential confusion.
  • Replaced stdout with _stdout in test_follows_redirects_on_HEAD
  • Replaced stdout with _stdout in test_follows_redirects_on_GET
tests/test_builders/test_build_linkcheck.py
The ruff dependency has been updated to version 0.11.0 in pyproject.toml.
  • Updated ruff version from 0.9.9 to 0.11.0
pyproject.toml
Unused variables have been removed in the other directives. This improves code clarity and reduces potential errors.
  • Replaced rel_filename with _rel_filename in Includefile.run
sphinx/directives/other.py
Unused variables have been removed in the C domain parser. This improves code clarity and reduces potential errors.
  • Replaced trailing_comma with _trailing_comma in _parse_paren_expression_list
sphinx/domains/c/_parser.py
Unused variables have been removed in the citation domain. This improves code clarity and reduces potential errors.
  • Replaced lineno with _lineno in resolve_xref
sphinx/domains/citation.py
Unused variables have been removed in the cpp domain. This improves code clarity and reduces potential errors.
  • Replaced fail_reason with _fail_reason in apply
  • Replaced trailing_comma with _trailing_comma in _parse_paren_expression_list
sphinx/domains/cpp/__init__.py
sphinx/domains/cpp/_parser.py
Unused variables have been removed in the rst domain. This improves code clarity and reduces potential errors.
  • Replaced parents with _parents in _toc_entry_name
sphinx/domains/rst.py
Unused variables have been removed in the indexentries adapter. This improves code clarity and reduces potential errors.
  • Replaced targets and sub_items with _targets and _sub_items in _group_by_func
sphinx/environment/adapters/indexentries.py
Unused variables have been removed in the asset collector. This improves code clarity and reduces potential errors.
  • Replaced basename with _basename in collect_candidates
sphinx/environment/collectors/asset.py
Unused variables have been removed in the autosummary extension. This improves code clarity and reduces potential errors.
  • Replaced parent with _parent in import_ivar_by_name
  • Replaced real_name and parent with _real_name and _parent in find_autosummary_in_docstring
sphinx/ext/autosummary/__init__.py
sphinx/ext/autosummary/generate.py
Unused variables have been removed in the inheritance_diagram extension. This improves code clarity and reduces potential errors.
  • Replaced x with _x in run
sphinx/ext/inheritance_diagram.py
Unused variables have been removed in the napoleon extension. This improves code clarity and reduces potential errors.
  • Replaced colon with _colon in _consume_field
sphinx/ext/napoleon/docstring.py
Unused variables have been removed in roles.py. This improves code clarity and reduces potential errors.
  • Replaced target with _target in create_non_xref_node
sphinx/roles.py
Unused variables have been removed in docfields.py. This improves code clarity and reduces potential errors.
  • Replaced messages with _messages in make_xref
sphinx/util/docfields.py
Unused variables have been removed in docutils.py. This improves code clarity and reduces potential errors.
  • Replaced level with _level in UnfilteredSubsystem.write
sphinx/util/docutils.py
Unused variables have been removed in texinfo.py. This improves code clarity and reduces potential errors.
  • Replaced used with _used in visit_footnote_reference
sphinx/writers/texinfo.py
Unused variables have been removed in test_config.py. This improves code clarity and reduces potential errors.
  • Replaced default, rebuild, and valid_types with _default, _rebuild, and _valid_types
  • Replaced _ with opt[0]
tests/test_config/test_config.py
Unused variables have been removed in test_domain_py.py. This improves code clarity and reduces potential errors.
  • Replaced name_prefix, tp_list, and name with _name_prefix, _tp_list, and _name
tests/test_domains/test_domain_py.py
Unused variables have been removed in test_ext_coverage.py. This improves code clarity and reduces potential errors.
  • Replaced py_undocumented and py_documented with _py_undocumented and _py_documented
tests/test_extensions/test_ext_coverage.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

vwheeler63 and others added 23 commits March 20, 2025 01:05
AA-Turner and others added 30 commits May 18, 2025 04:18
The 'Porter' stemmer is considered frozen.
Docutils revision r10129 [1] removes the member from the namespace.

[1]: https://sourceforge.net/p/docutils/code/10129/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.