Closed oczkoisse closed 2 years ago
@oczkoisse 👋 Thank you so much for the fix and sorry for the delay in reviewing the PR. After my latest commit e5880d5
(#550) in order to preserve b/w compat for match patterns like (src\/*\.py
) i.e patterns that match a full path for eg. - it seems like it breaks the test you added for the negative regex matches.
I am in a difficult conundrum with this since one way breaks b/w compat for nested match paths and the other causes issues with negative match directives.
Re-thinking this PR in the context of #529 - I think it might be better for me to revert my latest commit and merge #529 to have proper support for nested dir paths.
Thanks @samj1912 for taking the time to review this PR. I think #529 is a good way to provide an alternative to people who rely on --match
to match against nested paths.
Fixes #549.
This uses
os.path.basename
before trying to match against the pattern set in--match
option. This way, even if full paths to files are passed topydocstyle
(by VSCode, for example), only filename part of the path will be matched with the set pattern, thereby eliminating accidental matches with the path. This is also more consistent with how--match
is documented previously.Please make sure to check for the following items:
If you've added an error code or changed an error code behavior, you should probably add or change a test case file under
tests/test_cases/
and add it to the list undertests/test_definitions.py
.If you've added or changed a command line option, you should probably add or change a test in
tests/test_integration.py
.Make sure to include the PR number after you open and get one.