scripts: get_maintainer: Fix glob pattern directory match error logic
The `get_maintainer` script currently generates an error when a non- slash-suffixed glob pattern matches any directories -- this is incorrect because the glob pattern may be used to match files. This commit updates the script to only generate an error when a non-slash suffixed _only_ matches directories. Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
This commit is contained in:
parent
9028ad5d71
commit
428f4a6466
1 changed files with 3 additions and 4 deletions
|
@ -524,10 +524,9 @@ def _check_maintainers(maints_path, yaml):
|
|||
"match any files".format(glob_pattern, files_key,
|
||||
area_name))
|
||||
if not glob_pattern.endswith("/"):
|
||||
for path in paths:
|
||||
if path.is_dir():
|
||||
ferr("glob pattern '{}' in '{}' in area '{}' "
|
||||
"matches a directory, but has no "
|
||||
if all(path.is_dir() for path in paths):
|
||||
ferr("glob pattern '{}' in '{}' in area '{}' "
|
||||
"matches only directories, but has no "
|
||||
"trailing '/'"
|
||||
.format(glob_pattern, files_key,
|
||||
area_name))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue