Skip to content
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

missing-docstring is emitted even with docstrings written. #1722

Closed
Everspace opened this issue Oct 31, 2017 · 4 comments
Closed

missing-docstring is emitted even with docstrings written. #1722

Everspace opened this issue Oct 31, 2017 · 4 comments
Labels
Enhancement ✨ Improvement to a component python 3.7

Comments

@Everspace
Copy link

Everspace commented Oct 31, 2017

Steps to reproduce

Use the following snippet for example.py:

#!/usr/bin/env python
"""
Does Things
"""

def dotinate(strings):
    """Joins an iterable with dots"""
    return '.'.join(strings)

help(__name__)

Current behavior

Running

pylint example.py

Results in

##########Linting Output - pylint##########
************* Module example
1,0,convention,C0111:Missing module docstring
6,0,convention,C0111:Missing function docstring

Expected behavior

Silence

pylint --version output

No config file found, using default configuration
pylint 1.7.4,
astroid 1.5.3
Python 3.7.0a2 (v3.7.0a2:f7ac4fe, Oct 17 2017, 17:06:29) [MSC v.1900 64 bit (AMD64)]

On Windows 10 Pro Build 15063.674

@rogalski rogalski self-assigned this Nov 1, 2017
@rogalski
Copy link
Contributor

rogalski commented Nov 1, 2017

It does not reproduce on any released versions of Python interpreter.

It's likely related to this entry in core changelog:

Module, FunctionDef, AsyncFunctionDef, and ClassDef AST nodes now have a new docstring field. The first statement in their body is not considered as a docstring anymore. co_firstlineno and co_lnotab of code object for class and module are affected by this change. (Contributed by INADA Naoki and Eugene Toder in bpo-29463.)

@rogalski rogalski removed their assignment Nov 1, 2017
@rogalski
Copy link
Contributor

rogalski commented Nov 1, 2017

Adding link to relevant patch in CPython code, in case anyone want to take a shot at it: python/cpython#46

@PCManticore
Copy link
Contributor

Fun times, supporting 3.7. :)

@PCManticore PCManticore added the Enhancement ✨ Improvement to a component label Nov 2, 2017
@PCManticore
Copy link
Contributor

This is fixed in the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component python 3.7
Projects
None yet
Development

No branches or pull requests

3 participants