Skip to content

Commit 4f4ad2e

Browse files
nashifkartben
authored andcommitted
maintainers: add options to area command
Add options to area command: --without-maintainers --without-collaborators To show areas without any collaborators or maintainers. Signed-off-by: Anas Nashif <[email protected]>
1 parent 047c9f5 commit 4f4ad2e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

scripts/get_maintainer.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@ def _parse_args():
109109
nargs="?",
110110
help="List all areas maintained by maintainer.")
111111

112+
# New arguments for filtering
113+
areas_parser.add_argument(
114+
"--without-maintainers",
115+
action="store_true",
116+
help="Exclude areas that have maintainers")
117+
areas_parser.add_argument(
118+
"--without-collaborators",
119+
action="store_true",
120+
help="Exclude areas that have collaborators")
121+
112122
areas_parser.set_defaults(cmd_fn=Maintainers._areas_cmd)
113123

114124
orphaned_parser = subparsers.add_parser(
@@ -290,6 +300,13 @@ def multiline(items):
290300
for area in self.areas.values():
291301
maintainers = multiline(area.maintainers)
292302
collaborators = multiline(area.collaborators)
303+
304+
# Filter based on new arguments
305+
if getattr(args, "without_maintainers", False) and area.maintainers:
306+
continue
307+
if getattr(args, "without_collaborators", False) and area.collaborators:
308+
continue
309+
293310
if args.maintainer:
294311
if args.maintainer in area.maintainers:
295312
table.append([
@@ -304,7 +321,6 @@ def multiline(items):
304321
collaborators
305322
])
306323
if table:
307-
# Use plain tablefmt for better multi-line cell support
308324
print(tabulate(
309325
table,
310326
headers=["Area", "Maintainers", "Collaborators"],

0 commit comments

Comments
 (0)