Skip to content

Conversation

codex-maintainers
Copy link
Contributor

@codex-maintainers codex-maintainers commented Mar 21, 2025

Summary

The documentation for collections-named-tuple (PYI024) was using a lowercase variable in its example:

from collections import namedtuple

person = namedtuple("Person", ["name", "age"])

while the recommended replacement used class Person – implying a name change that's not equivalent. This patch updates the docstring to use a more canonical example:

from collections import namedtuple

Person = namedtuple("Person", ["name", "age"])

so that the “Use instead:” block aligns with the original name and doesn't suggest a breaking rename. No functional code changes were required.

Test Plan

Only documentation comments were updated; the existing flake8_pyi tests still pass (cargo test -p ruff_linter). Running the full workspace tests yields a failure in an unrelated snapshot when run as root, but in a typical developer environment the existing tests and snapshots remain unaffected. All style and lint checks pass (cargo clippy, cargo fmt, etc.).


This PR was generated by an AI system in collaboration with maintainers: @carljm, @ntBre

Fixes #16492

@ntBre ntBre added the documentation Improvements or additions to documentation label Mar 21, 2025
Copy link
Contributor

github-actions bot commented Mar 21, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser
Copy link
Member

Closing because we never got to reviewing this PR.

@AlexWaygood
Copy link
Member

This change seems correct to me

@AlexWaygood AlexWaygood reopened this Jun 20, 2025
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

thanks! Sorry it took us a while to review

@AlexWaygood AlexWaygood marked this pull request as ready for review June 20, 2025 13:27
@AlexWaygood AlexWaygood enabled auto-merge (squash) June 20, 2025 13:28
@AlexWaygood AlexWaygood merged commit 234d248 into astral-sh:main Jun 20, 2025
53 checks passed
dcreager added a commit that referenced this pull request Jun 20, 2025
* main: (21 commits)
  [`flake8-logging`] Avoid false positive for `exc_info=True` outside `logger.exception` (`LOG014`) (#18737)
  [`flake8-pie`] Small docs fix to `PIE794` (#18829)
  [`pylint`] Ignore __init__.py files in (PLC0414) (#18400)
  Avoid generating diagnostics with per-file ignores (#18801)
  [`flake8-simplify`] Fix false negatives for shadowed bindings  (`SIM910`, `SIM911`) (#18794)
  [ty] Fix panics when pulling types for `ClassVar` or `Final` parameterized with >1 argument (#18824)
  [`pylint`] add fix safety section (`PLR1714`) (#18415)
  [Perflint] Small docs improvement to `PERF401` (#18786)
  [`pylint`] Avoid flattening nested `min`/`max` when outer call has single argument (`PLW3301`) (#16885)
  [`ruff`] Added `cls.__dict__.get('__annotations__')` check (`RUF063`) (#18233)
  [ty] Use `HashTable` in `PlaceTable` (#18819)
  docs: Correct collections-named-tuple example to use PascalCase assignment (#16884)
  [ty] ecosystem-analyzer workflow (#18719)
  [ty] Add support for `@staticmethod`s (#18809)
  unnecessary_dict_kwargs doc - a note on type checking benefits (#18666)
  [`flake8-pytest-style`] Mark autofix for `PT001` and `PT023` as unsafe if there's comments in the decorator (#18792)
  [ty] Surface matched overload diagnostic directly (#18452)
  [ty] Report when a dataclass contains more than one `KW_ONLY` field (#18731)
  [`flake8-pie`] Add fix safety section to `PIE794` (#18802)
  [`pycodestyle`] Add fix safety section to `W291` and `W293`  (#18800)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

collections-named-tuple (PYI024): Documented fix is not equivalent

4 participants