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

Report docstring content violations on docstring line (fixes #83) #238

Merged
merged 4 commits into from Dec 18, 2017

Conversation

@lordmauve
Copy link
Contributor

lordmauve commented Feb 27, 2017

Add .start and .end attributes to docstring objects that hold the starting and ending line numbers of the docstring token. Docstring was changed to a subclass of str to allow this, ensuring backwards compatibility.

Add a property .error_lineno to Definition. This will use the docstring's line number if it exists, or the definition's line number otherwise.

Finally, switch Error to use the new .error_lineno property.

Tested on Python 2.7, 3.3-3.5 and PyPy with Tox.

the start and end of the token.
"""
def __new__(cls, v, start, end):

This comment has been minimized.

Copy link
@Nurdok

Nurdok Feb 27, 2017

Member

Why is this needed? Why not just call super in __init__?

This comment has been minimized.

Copy link
@lordmauve

lordmauve Feb 27, 2017

Author Contributor

IIRC, you can't subclass various native types without defining new().

This comment has been minimized.

Copy link
@lordmauve

lordmauve Feb 27, 2017

Author Contributor

I confirmed, this is needed.

@lordmauve

This comment has been minimized.

Copy link
Contributor Author

lordmauve commented Apr 11, 2017

Bump. Is merging this blocked by #240?

@lordmauve

This comment has been minimized.

Copy link
Contributor Author

lordmauve commented Apr 23, 2017

Disappointed this didn't make 2.0.0. Please let me know what needs to happen for this to be merged.

@Nurdok

This comment has been minimized.

Copy link
Member

Nurdok commented Apr 25, 2017

@lordmauve sorry about that. I think this will go in the next minor version.

@lordmauve lordmauve force-pushed the lordmauve:docstring-linenos branch from 0788aba to 501b6f4 Dec 18, 2017
@lordmauve

This comment has been minimized.

Copy link
Contributor Author

lordmauve commented Dec 18, 2017

I just rebased. @Nurdok, can this be merged?

@Nurdok

This comment has been minimized.

Copy link
Member

Nurdok commented Dec 18, 2017

Hi @lordmauve, can you please just add a line to the release notes first?

@lordmauve

This comment has been minimized.

Copy link
Contributor Author

lordmauve commented Dec 18, 2017

I've added to the notes under a new minor version number. The release date will need to be added when you come to release this.

@@ -4,6 +4,14 @@ Release Notes
**pydocstyle** version numbers follow the
`Semantic Versioning <http://semver.org/>`_ specification.

2.2.0 - not yet released

This comment has been minimized.

Copy link
@Nurdok

Nurdok Dec 18, 2017

Member

Just put "Current Development Version" in the title instead of specifying the actual version.

This comment has been minimized.

Copy link
@lordmauve

lordmauve Dec 18, 2017

Author Contributor

Done.

New features

* Violations are now reported on the line where the docstring starts, not the
line of the ``def``/``class`` it corresponds to.

This comment has been minimized.

Copy link
@Nurdok

Nurdok Dec 18, 2017

Member

Link to both this (#238) and #83.

Sorry for the nitpicking, in a few moments this will be merged :)

This comment has been minimized.

Copy link
@lordmauve

lordmauve Dec 18, 2017

Author Contributor

Done.

@Nurdok
Nurdok approved these changes Dec 18, 2017
@Nurdok Nurdok merged commit ac20e2c into PyCQA:master Dec 18, 2017
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Nurdok

This comment has been minimized.

Copy link
Member

Nurdok commented Dec 18, 2017

Merged. @lordmauve, thank you so much for your patience, and for putting in the time to do this!

@lordmauve lordmauve deleted the lordmauve:docstring-linenos branch Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.