Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Allow matching for both the basename and the full pathname
Browse files Browse the repository at this point in the history
This is to avoid backward incompatible changes in case people are still relying on the old behavior.
  • Loading branch information
samj1912 committed Dec 30, 2021
1 parent 09b23a1 commit e5880d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/release_notes.rst
Expand Up @@ -17,7 +17,7 @@ New Features

Bug Fixes

* Fix ``--match`` option to only consider filename when matching full paths (#550).
* Fix ``--match`` option to consider both the base filename and the full-path when matching full paths (#550).

6.1.1 - May 17th, 2021
---------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/pydocstyle/config.py
Expand Up @@ -288,8 +288,8 @@ def _get_property_decorators(conf):
# Skip any dirs that do not match match_dir
dirs[:] = [d for d in dirs if match_dir(d)]

for filename in map(os.path.basename, filenames):
if match(filename):
for filename in filenames:
if match(filename) or match(os.path.basename(filename)):
full_path = os.path.join(root, filename)
yield (
full_path,
Expand All @@ -302,7 +302,7 @@ def _get_property_decorators(conf):
match, _ = _get_matches(config)
ignore_decorators = _get_ignore_decorators(config)
property_decorators = _get_property_decorators(config)
if match(os.path.basename(name)):
if match(name) or match(os.path.basename(name)):
yield (
name,
list(config.checked_codes),
Expand Down

0 comments on commit e5880d5

Please sign in to comment.