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

Support pycodestyle style wildcards. #209

Merged
merged 11 commits into from Nov 1, 2016

Conversation

Projects
None yet
2 participants
@andrewsomething
Copy link
Contributor

andrewsomething commented Oct 6, 2016

An attempt at implementing the request in #72

Suggestions on how to succinctly document this in the help output would be appreciated.

def _expand_error_codes(code_parts):
"""Returns expanded set of error codes to ignore."""
codes = set(ErrorRegistry.get_error_codes())
epanded_codes = set()

This comment has been minimized.

@Nurdok

Nurdok Oct 13, 2016

Member

Should be expanded_codes (missing the x).

This comment has been minimized.

@andrewsomething

andrewsomething Oct 18, 2016

Contributor

Good catch! Fixed.

epanded_codes = set()

for part in code_parts:
if len(part) < 4:

This comment has been minimized.

@Nurdok

Nurdok Oct 13, 2016

Member

Should an error be raised if this is false?

This comment has been minimized.

@andrewsomething

andrewsomething Oct 18, 2016

Contributor

I'm not entirely sure how it would reach such a state, but tried catching a TypeError here. Let me know if I'm not understanding something.

andrewsomething added some commits Oct 18, 2016

@andrewsomething andrewsomething force-pushed the andrewsomething:feature/72 branch from f4dd3ad to a3e29ae Oct 18, 2016

@Nurdok Nurdok referenced this pull request Oct 22, 2016

Closed

Ignore Wildcard #212

@Nurdok
Copy link
Member

Nurdok left a comment

Please also add docs to the new CLI interface and update the release notes.


@staticmethod
def _expand_error_codes(code_parts):
"""Returns expanded set of error codes to ignore."""

This comment has been minimized.

@Nurdok

Nurdok Oct 22, 2016

Member

The moment when your docstring wouldn't pass insepction by the tool that it's in :)

This comment has been minimized.

@andrewsomething

andrewsomething Oct 26, 2016

Contributor

:facepalm: Would have thought the tests would catch that...

@@ -324,6 +335,23 @@ def foo():
assert 'D103' not in err


def test_wildcard_add_ignore_cli(env):

This comment has been minimized.

@Nurdok

Nurdok Oct 22, 2016

Member

Please also add a negative test (e.g., trying to pass --add-ignore=D1034)

This comment has been minimized.

@andrewsomething

andrewsomething Oct 26, 2016

Contributor

Added another test. Let me know if it's not what you meant.

@@ -16,6 +16,7 @@ Major Updates
New Features

* Decorator-based skipping via ``--ignore-decorators`` has been added (#204).
* Support for using pycodestyle style wildcards has been added (#209).

This comment has been minimized.

@Nurdok

Nurdok Oct 28, 2016

Member

Please also specify the original issue (#72).

@@ -42,6 +42,14 @@ Usage
regular expression; default is --ignore-decorators=''
which does not ignore any decorated functions.

.. note::

This comment has been minimized.

@Nurdok

Nurdok Oct 28, 2016

Member

A shorter version of this should also be added the to flag description (add it in the code, then call pydocstyle --help and paste the result above). It should be succinct, e.g., replace "with a list of comma separated error codes" with "with a list of comma separated error codes or prefixes".

@Nurdok

Nurdok approved these changes Nov 1, 2016

@Nurdok Nurdok merged commit dc797d4 into PyCQA:master Nov 1, 2016

1 check passed

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

This comment has been minimized.

Copy link
Member

Nurdok commented Nov 1, 2016

Merged. Thanks!

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