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

Consider uppercase docstring prefixes at D300. #176

Merged
merged 1 commit into from Mar 2, 2016

Conversation

Projects
None yet
3 participants
@toroettg
Copy link
Contributor

commented Feb 28, 2016

While PEP 257 suggests to use lowercase literals, Python allows uppercase literals as string prefixes.

Unlike D301 and 302, error code D300 is not reported if uppercase docstring prefixes are being used (e.g., R'''...'''). The current implementation of D300 also causes a false positive for uppercase literals with double quotes (e.g., R"""Sum\\mary."""), and detects the quotes incorrectly for a ur'''...''' docstring prefix.

This proposes a more robust implementation for D300 and adds some uppercase tests for D301 and D302, which they already pass.

EDIT: For the sake of simplicity, the D302 uppercase literal test will be included in another PR.

@toroettg toroettg force-pushed the toroettg:D300UppercaseStringprefix branch from 3f89104 to 34aa554 Feb 28, 2016

@sigmavirus24

This comment has been minimized.

Copy link
Member

commented Feb 28, 2016

This looks good to me. Seems reasonable too.

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

x.x.x - unknown date

This comment has been minimized.

Copy link
@Nurdok

Nurdok Mar 1, 2016

Member

Instead write "Current Development Version".

@Nurdok

This comment has been minimized.

Copy link
Member

commented Mar 1, 2016

Looks good. Just fix the small comment I made in the docs and I'll merge this.

@toroettg toroettg force-pushed the toroettg:D300UppercaseStringprefix branch from 34aa554 to a29eeeb Mar 2, 2016

@toroettg

This comment has been minimized.

Copy link
Contributor Author

commented Mar 2, 2016

Gladly done!

@sigmavirus24

This comment has been minimized.

Copy link
Member

commented Mar 2, 2016

Still looks good to me. I think @Nurdok wanted that entire line replaced with "Current development version" but ¯\_(ツ)_/¯

@Nurdok

This comment has been minimized.

Copy link
Member

commented Mar 2, 2016

That is what I meant, but I'll just change this manually right after this merge.
Thanks, @toroettg!

Nurdok added a commit that referenced this pull request Mar 2, 2016

Merge pull request #176 from toroettg/D300UppercaseStringprefix
Consider uppercase docstring prefixes at D300.

@Nurdok Nurdok merged commit b790ec8 into PyCQA:master Mar 2, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@toroettg toroettg deleted the toroettg:D300UppercaseStringprefix branch Mar 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.