pydocstyle icon indicating copy to clipboard operation
pydocstyle copied to clipboard

Add a match_path option for comparison against a full path.

Open heoga opened this issue 4 years ago • 3 comments

It has been noted in issue #363 that match & match_dir are unwieldy when attempting to match against full paths. For unexample if you have A.py in directories B & C and you only want to run pydocstyle on one of them.

From my own experience trying to deploy pydocstyle against a large legacy codebase it is unworkable as it would mean the entire codebase being converted as a big bang change.

This commit adds a new option, match_path, to the config & command lines which can be used to provide more nuanced matching. For example the following specification:

match_path = [AB]/[ab].py
             D/e.py

This defines two regexes. If either match a given path, relative to the directory specified, the file will be yielded for comparison. The is complimentary to match & match_dir and the three can be used together.

A test has been added to test_integration to test & illustrate the feature. tox was run on Linux (Ubuntu under the subsystem for Windows) and all tests were successful.

Fixes #363

heoga avatar Apr 01 '21 07:04 heoga

@heoga thank you so much for this PR! Sorry for the late review. Would it be possible for you to rebase this PR against the latest changes in the master branch?

sambhav avatar Dec 30 '21 21:12 sambhav

Yes, I'll get it updated against the latest changes and see how it looks.

heoga avatar Jan 16 '22 19:01 heoga

Any updates on this PR? It would help me a lot. Can I somehow help?

dynobo avatar Jun 09 '22 13:06 dynobo