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

Commit e5880d5

Browse files
authored
Allow matching for both the basename and the full pathname
This is to avoid backward incompatible changes in case people are still relying on the old behavior.
1 parent 09b23a1 commit e5880d5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/release_notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ New Features
1717

1818
Bug Fixes
1919

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

2222
6.1.1 - May 17th, 2021
2323
---------------------------

src/pydocstyle/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ def _get_property_decorators(conf):
288288
# Skip any dirs that do not match match_dir
289289
dirs[:] = [d for d in dirs if match_dir(d)]
290290

291-
for filename in map(os.path.basename, filenames):
292-
if match(filename):
291+
for filename in filenames:
292+
if match(filename) or match(os.path.basename(filename)):
293293
full_path = os.path.join(root, filename)
294294
yield (
295295
full_path,
@@ -302,7 +302,7 @@ def _get_property_decorators(conf):
302302
match, _ = _get_matches(config)
303303
ignore_decorators = _get_ignore_decorators(config)
304304
property_decorators = _get_property_decorators(config)
305-
if match(os.path.basename(name)):
305+
if match(name) or match(os.path.basename(name)):
306306
yield (
307307
name,
308308
list(config.checked_codes),

0 commit comments

Comments
 (0)