Skip to content

GH-137623: Use an AC decorator for docstring line length enforcement #137690

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

Merged
merged 3 commits into from
Aug 18, 2025

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Aug 12, 2025

After thinking about it, @serhiy-storchaka's suggestion to use a decorator seems a better approach. It keeps the information localised to where the problem is, rather than hiding it in libclinic, which most contributors shouldn't need to worry about.

Opening as draft to avoid review-request spam until ready for merge.

A

@AA-Turner AA-Turner force-pushed the clinic/overlong-docstrings-deco branch from fbb070c to 37dbdf7 Compare August 12, 2025 21:15
@skirpichev

This comment was marked as resolved.

@AA-Turner

This comment was marked as resolved.

@AA-Turner
Copy link
Member Author

I'd prefer to merge this, I think it's a cleaner solution than the current. @serhiy-storchaka do you have any objections?

A

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

ДПЕЬю Ж+1Ж

@serhiy-storchaka
Copy link
Member

LGTM. 👍

@AA-Turner
Copy link
Member Author

ДПЕЬю Ж+1Ж

Google translate doesn't have any suggestions here!

@AA-Turner
Copy link
Member Author

Thank you!

@AA-Turner AA-Turner merged commit 918e3ba into python:main Aug 18, 2025
56 checks passed
@AA-Turner AA-Turner deleted the clinic/overlong-docstrings-deco branch August 18, 2025 17:29
@picnixz
Copy link
Member

picnixz commented Aug 18, 2025

Oh, I would have suggested @allow_* instead of permit but it's merged now.

@AA-Turner
Copy link
Member Author

Sorry, I wanted to minimise review spam so kept it in draft. Happy to change it if you'd like?

My rationale for "permit" instead of "allow" was to signal that this is an exception to the rule -- we don't want to see the number of exceptions go up here. "allow" could be seen as a supported way to bypass the checks, which we'd prefer to avoid.

I realise that this is a very slight semantic difference, though!

@picnixz
Copy link
Member

picnixz commented Aug 18, 2025

Oh, if that's your rationale, I'm ok with it though in this case I would have had some "ignore_maxline_length" instead or "disable_docstring_length_check" but I'm fine the permit prefix.

@skirpichev
Copy link
Contributor

Google translate doesn't have any suggestions here!

ДПЕЬ is LGTM in Russian (or Ukrainian, I think that part of keyboard has no difference). Shame on Google!

Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
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.

4 participants