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

Separate error for missing docstring on nested (Meta) classes #198

Open
hvdklauw opened this Issue Jul 14, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@hvdklauw
Copy link

hvdklauw commented Jul 14, 2016

In django the usage of a nested Meta class is pretty common, however adding docstrings to those classes is just silly.

Would be nice to have it separated from normal classes so we could turn off the need for a docstring there.

@jayvdb

This comment has been minimized.

Copy link
Member

jayvdb commented Jul 14, 2016

This issue is about a nested class named Meta.
https://docs.djangoproject.com/en/dev/topics/db/models/#meta-options

I doubt special-casing that name is appropiate, although it could be done in conjunction with special casing of the outer-class subclassing models.Model, but then we have the problem that the ast cant detect indirect subclassing.

The other approach is a separate error for any nested classes, and probably also nested functions if they are not already a different error or no error.

Any other approaches?

@hvdklauw

This comment has been minimized.

Copy link

hvdklauw commented Jul 14, 2016

I dislike the first option, then soon there will be some other special case somewhere in the python eco system and we'll end up with many lines of code to handle all those special cases.

I think the separate errors for nested classes and for nested functions (2 extra errors) would be much nicer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment