Skip to content

fix: guard None class docstring in update_class_documentation - #493

Open
Shtirmann wants to merge 1 commit into
mainfrom
fix/update-class-doc-none-guard
Open

fix: guard None class docstring in update_class_documentation#493
Shtirmann wants to merge 1 commit into
mainfrom
fix/update-class-doc-none-guard

Conversation

@Shtirmann

@Shtirmann Shtirmann commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

В проходе обновления по main idea (incremental=False) ВСЕ классы уходят в update_class_documentation - в том числе классы без докстринга. А метод сразу делает class_details[-1].split("\n\n", ...), и в except-фолбэке - class_details[-1].strip(). Когда у класса нет докстринга, class_details[-1] это None, и обе строки падают с AttributeError: 'NoneType' has no attribute 'split'/'strip'.

Падает не тихо: исключение рушит весь batch обновления классов через asyncio.gather, и DocstringsGenerator.run() возвращает {"result": None} - хотя докстринги функций/методов к этому моменту уже записаны.

Воспроизводится на реальном репо sindresorhus/yocto-queue: классы Node/Queue без докстрингов -> краш в update-проходе -> run() -> None.

Поправил.

@DRMPN DRMPN left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

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.

3 participants